Content of this page
Table of Contents
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 ?s
WHERE {
?s rdf:type skos:ConceptScheme .
}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 .
}.
}
limit 10
On concept schemes
Get all skos:ConceptScheme in a repo
SELECT ?s
WHERE {
?s rdf:type skos:ConceptScheme .
}
On skos:Collections
Get all members of skos:collection "fisheries"
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 .
}
Manipulate data
Add a triple to all skos:Concept in a graph
INSERT
{ GRAPH <graph_name>
{?s prefix:property <property_value> } }
WHERE {
?s rdf:type skos:Concept .
}