Project:SPARQL/examples: Difference between revisions

Jump to navigation Jump to search
Line 136: Line 136:


<sparql tryit="1">
<sparql tryit="1">
# mixing data from this Wikibase with data from Wikidata
# Federated querying: mixing data from this Wikibase with data from Wikidata  


PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
Line 144: Line 144:
PREFIX wdt: <https://kbtestwikibase.wikibase.cloud/prop/direct/>
PREFIX wdt: <https://kbtestwikibase.wikibase.cloud/prop/direct/>


SELECT ?p ?pType
SELECT ?item ?itemLabel ?itemDescription
?pLabelNL ?pLabelEN
?wikidataEquivalentURI
?pDescriptionNL ?pDescriptionEN
(GROUP_CONCAT(DISTINCT ?pAliasNL ; separator = "|") as ?pAliasesNL )
(GROUP_CONCAT(DISTINCT ?pAliasEN ; separator = "|") as ?pAliasesEN )
?wikidataEquivalentProperty


WHERE {
WHERE  
{
  ?item wikibase:identifiers ?b
  ?item wdt:P1 ?wikidataEquivalentURI.


   ?p wikibase:propertyType ?pType .
   SERVICE wikibase:label { bd:serviceParam wikibase:language "nl". }
  OPTIONAL{?p wdt:P1 ?wikidataEquivalentProperty.}
 
  OPTIONAL{?p rdfs:label ?pLabelNL FILTER(LANG(?pLabelNL)='nl').}
  OPTIONAL{?p rdfs:label ?pLabelEN FILTER(LANG(?pLabelEN)='en').}
 
  OPTIONAL{?p schema:description ?pDescriptionNL FILTER(LANG(?pDescriptionNL) = "nl"). } 
  OPTIONAL{?p schema:description ?pDescriptionEN FILTER(LANG(?pDescriptionEN) = "en"). }
 
  OPTIONAL{?p skos:altLabel ?pAliasNL FILTER(LANG(?pAliasNL) = "nl"). } 
  OPTIONAL{?p skos:altLabel ?pAliasEN FILTER(LANG(?pAliasEN) = "en"). }    
      
      
}
}
GROUP BY ?p ?pType ?pLabelNL ?pLabelEN ?pDescriptionNL ?pDescriptionEN ?wikidataEquivalentProperty
 
ORDER BY ASC(xsd:integer(STRAFTER(STR(?p), 'P')))
ORDER BY ASC(xsd:integer(STRAFTER(STR(?item), 'Q')))
</sparql>
</sparql>
emailconfirmed
952

edits

Navigation menu