Project:SPARQL/examples: Difference between revisions

Line 1,066: Line 1,066:
   ?property
   ?property
   ?propertyType
   ?propertyType
   ?propertyLabel
   ?propertyLabel # ?propertyAltLabel
  ?propertyAltLabel
   ?propertyDescription
   ?propertyDescription
WHERE {
WHERE {
Line 1,073: Line 1,072:
               rdfs:label ?propertyLabel ;
               rdfs:label ?propertyLabel ;
               wikibase:propertyType ?propertyType .
               wikibase:propertyType ?propertyType .
  OPTIONAL { ?property skos:altLabel ?propertyAltLabel . }
 
   OPTIONAL { ?property schema:description ?propertyDescription . }
# OPTIONAL { ?property skos:altLabel ?propertyAltLabel . } # not many of these and creates dups so meh
 
   OPTIONAL { ?property schema:description ?propertyDescription . } # much more useful
    
    
   FILTER(LANG(?propertyLabel) = 'en') # removes label language dups (but not description dups)
   FILTER(LANG(?propertyLabel) = 'en') # fix label language dups (Q: but why doesn't service wikibase:label work for this?)
 
  filter ( not exists {?property schema:description ?propertyDescription .} || lang(?propertyDescription)='en' ) # filter for propertyDescription: *either* lang=en or not present
 
}
}


579

edits