Project:SPARQL/examples: Difference between revisions

Line 1,074: Line 1,074:
               wikibase:propertyType ?propertyType .
               wikibase:propertyType ?propertyType .


# OPTIONAL { ?property skos:altLabel ?propertyAltLabel . } # not many of these
# OPTIONAL { ?property skos:altLabel ?propertyAltLabel . } # not many of these


   OPTIONAL { ?property schema:description ?propertyDescription .  
   OPTIONAL { ?property schema:description ?propertyDescription .  
      filter(lang(?propertyDescription)='en' ) . # works a lot better if you put the filter here!!
        #filter(lang(?propertyDescription)='en' ) . # misses 2 that have en-gb only
   } # much more useful
        SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb,en".
          ?property schema:description ?propertyDescription .
        }
   }  
    
    
   FILTER(LANG(?propertyLabel) = 'en') # fix label language dups (Q: but why doesn't service wikibase:label work for this?)
   #FILTER(LANG(?propertyLabel) = 'en') # fix label language dups  
 
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb,en".
          ?property rdfs:label         ?propertyLabel.
        }


}
}
586

edits