0

I am currently retrieving information about a subject using following query:

DESCRIBE <http://dbpedia.org/resource/Albert_Einstein>

How can I edit this query to only get information where predicate is dbpedia property (http://dbpedia.org/property/*)?

user221458
  • 716
  • 2
  • 7
  • 17
  • 1
    possible duplicate of [Exclude results from DBpedia SPARQL query based on URI prefix](http://stackoverflow.com/questions/19044871/exclude-results-from-dbpedia-sparql-query-based-on-uri-prefix) – Joshua Taylor Feb 23 '14 at 12:51
  • The question of which this is a duplicate is looking to _exclude_ results that begin with a particular IRI, and so uses a filter `FILTER ( !strstarts(str(?concept), "http://dbpedia.org/class/yago/") )`. Here you only want ones beginning with a particular IRI, so you'd use `FILTER ( strstarts(str(?property), "http://dbpedia.org/property/") )`. – Joshua Taylor Feb 23 '14 at 12:53
  • Also note that you'll only be keeping the DBpedia infobox properties. You might want to keep the DBpedia ontology properties too. They begin with `http://dbpedia.org/ontology/`, and the values for those is much "cleaner". – Joshua Taylor Feb 23 '14 at 12:54

1 Answers1

3

To get one particular property:

SELECT ?o { <http://dbpedia.org/resource/Albert_Einstein> <http://dbpedia.org/property/...> ?o }

or to get all properties beginning with http://dbpedia.org/property/

SELECT ?p ?o { 
  <http://dbpedia.org/resource/Albert_Einstein> ?p ?o .
  FILTER(STRSTARTS(str(?p), "http://dbpedia.org/property/")))
}
Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353
AndyS
  • 16,345
  • 17
  • 21