0

Let's say that I have a name. How can I write a sparql query to wikidata to determine if it is a museum exponate?

For example this query returns all the items on wikidata matching the name "The

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
select ?thing 
where 
{ 
  ?thing rdfs:label "The Kiss"@en
}

One of this results will have the field instance of with value monumental sculpture. However, I may have another entry which is a painting. Is there another way to determine if given the name of an exponate it is indeed a museum exponate. Another that simply having the value of instance of field hardcoded locally along with the name of the exponate?

cristid9
  • 1,070
  • 1
  • 17
  • 37
  • 1
    Perhaps `filter exists { ?thing wdt:P195 [] }`. – Stanislav Kralin Jan 19 '20 at 13:39
  • 2
    either that or following the location to any type of museum maybe? `PREFIX rdfs: select ?thing where { ?thing rdfs:label "The Kiss"@en ; wdt:P276/wdt:P31/wdt:P279* wd:Q33506 }` - maybe even a UNION of both? Might also be worth to check for diffs between both queries to find corner cases – UninformedUser Jan 19 '20 at 15:39

0 Answers0