Content of this page
On graphs
Get all distinct graphs in a repo
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
SELECT DISTINCT ?g
WHERE {
GRAPH ?g { }
}
Get all triples in a given graph
SELECT * from named <https://unstats.un.org/classifications/CPC/v2.1/> {
GRAPH ?g { ?s ?p ?o }.
}
Get al items in
SELECT ?collection_code ?concept_code ?concept_label WHERE {
?collection skos:notation ?collection_code . FILTER (str(?collection_code)='fisheries') .
?collection skos:member ?concept .
?concept skos:notation ?concept_code .
?concept skos:prefLabel ?concept_label .
}
On concept schemes
Get all skos:ConceptScheme in a repo
SELECT ?s
WHERE {
?s rdf:type skos:ConceptScheme .
}
Queries for SWS
Get all acronyms
export const getAllAchronysms = `PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX dct: <http://purl.org/dc/terms/>
SELECT DISTINCT ?acronym ?label_en ?label_fr ?label_es ?label_ru ?descr
WHERE {
?scheme rdf:type skos:ConceptScheme . FILTER(""" + exclusion + """) .
?scheme skos:notation ?acronym .
?scheme skos:prefLabel ?label_en . FILTER (lang(?label_en)= "en" || lang(?label_en)= "") .
OPTIONAL{?scheme dc:description|dct:description|rdfs:comment ?descr . FILTER (lang(?descr)= "en" || lang(?descr)= "") } .
OPTIONAL{?scheme skos:prefLabel ?label_fr . FILTER (lang(?label_fr)= "fr")} .
OPTIONAL{?scheme skos:prefLabel ?label_es . FILTER (lang(?label_es)= "es")} .
OPTIONAL{?scheme skos:prefLabel ?label_ru . FILTER (lang(?label_ru)= "ru")} .
}
ORDER BY ?acronym