0

this is probably an easy one, and asked before but I couldnt find anything to help me on here or elsewhere online, man this syntax is messing with me!

I want to get subpropeties of a property.

so lets keep it simple with my man Bernie Sanders (Q359442), I can get all of his positions held (P39)...

SELECT ?position WHERE {
  ?person wdt:P39 ?position.
  FILTER(?person = wd:Q359442)
}

that was easy enough, but how do I access all of the sub-data found within? Like start time (P580).

I've seen rdfs:subPropertyOf but no matter what I do with this all it does it give me zero results instead of 3!

  • 2
    Reading about the [Wikidata data model](https://www.mediawiki.org/wiki/Wikibase/DataModel/Primer) is the first step to build the SPARQL query. – UninformedUser Oct 14 '18 at 17:20
  • Example with start and possible end time: `SELECT ?personLabel ?positionLabel ?start_time ?end_time WHERE { ?person p:P39 ?position_statement. ?position_statement ps:P39 ?position. ?position_statement pq:P580 ?start_time. optional {?position_statement pq:P582 ?end_time} FILTER(?person = wd:Q359442) SERVICE wikibase:label { bd:serviceParam wikibase:language "en" } }` – UninformedUser Oct 14 '18 at 17:28

0 Answers0