1
votes

I've recently dived in the world of semantic web. It's been smooth, until now. To the point... I'm trying to get Articles from dbpedia, but I don't get results somehow. For what I have seen in the DBpedia ontology, I think this is supposed to be correct. Article is a "subclass" of WrittenWork, so is Book. I can get books and their info through the rdf triples. When using a SPARQL query that is almost the same as the one for books, I don't get results. This is weird, because I know there are references to articles in Wikipedia.

The query for books:

SELECT DISTINCT ?book
WHERE { ?book a dbo:Book . }

If I substitute dbo:Book for dbo:Article, I get nothing. I'm testing here: http://dbpedia.org/sparql

Can someone point me the right direction?

1
What is your namespace definition for the prefix dbo:? - scotthenninger
Do you know any resource in DBpedia which is an article? - Ivo Velitchkov
@scotthenninger it's one of the default prefixes that you can see in dbpedia.org/sparql - Daniel Mendonça
@IvoVelitchkov not in DBpedia, but I found more than one page in wikipedia that I think should be classified as such, and using the query you wrote in your answer I can confirm it has none. - Daniel Mendonça
@DanielMendonça an article should be a topic of a Wikipedia page to be classified as such. And if you have such an example, please share it. - Ivo Velitchkov

1 Answers

5
votes

If you test which subslasses of dbo:WrittenWork have no members, using this query

SELECT DISTINCT *
WHERE { 
  ?class rdfs:subClassOf dbo:WrittenWork .
  FILTER NOT EXISTS {?s a ?class }
}

you'll see that dbo:Article is among them.