java - How to retrieve DBPedia 'class' attribute for a given word using Sparql? -
so have word like, example, 'horse', , want retrieve class. 'mammal', shown here: http://dbpedia.org/page/horse .
i tried something, it's not returning anything.
string querystring = "prefix dbr: <http://dbpedia.org/resource/>" + "prefix dbo: <http://dbpedia.org/ontology/>" + "select ?class {dbr:horse dbo:?class}"; any advices ?
sparql queries make use of so-called triple patterns, query returns tuple , second part in strange syntax. moreover, instances asserted classes rdf:type property. dbo:class on other hand more property biological term class. obviously, query ill-formed , dbo:class part overlap ?class variable. i'm wondering why didn't see - it's obvious...
prefix dbr: <http://dbpedia.org/resource/> prefix dbo: <http://dbpedia.org/ontology/> select ?class { dbr:horse dbo:class ?class }
Comments
Post a Comment