"Seegrid will be due for a migration to confluence on the 1st of August. Any update on or after the 1st of August will NOT be migrated"

SPARQL patterns for SISSvoc

This SPARQL was used to verify that the designated information could be retrieved from the RDF source. Configuration of a SISSSvoc deployment may use these SPARQL queries directly, or may build the queries using a different syntax (e.g. LDA).

0

Describe the resource
DESCRIBE {URI}

1

List of all concept schemes
SELECT ?item 
WHERE {
   ?item a skos:ConceptScheme .
}

2

List of all concept collections
SELECT ?item 
WHERE {
  ?item a ?type . FILTER ( ?type = skos:Collection || ?type = skos:OrderedCollection )
}

3

List of all concepts
SELECT ?item 
WHERE {
  ?item a skos:Concept .
}

4

List of concepts where a SKOS label matches this text
SELECT ?item 
WHERE {
  ?item a skos:Concept . 
   ?item ?label ?l . 
   FILTER ( ?label = skos:prefLabel || ?label = skos:altLabel ) 
   FILTER ( ?l = {text}@en )
}

5

List of concepts where a SKOS label contains this text
SELECT ?item 
WHERE {
  ?item a skos:Concept . 
   ?item ?label ?l . 
   FILTER ( ?label = skos:prefLabel || ?label = skos:altLabel ) 
   FILTER regex( str(?l) , {text} , 'i' )
}

6

List of concepts skos:broader than the concept identified by URI
SELECT ?item 
WHERE {
  ?item a skos:Concept . 
   {URI} skos:broader ?item .
}

7

List of concepts skos:narrower than the concept identified by URI
SELECT ?item 
WHERE {
  ?item a skos:Concept . 
   {URI} skos:narrower ?item .
}

8

List of concepts skos:broaderTransitive than the concept identified by URI
SELECT ?item 
WHERE {
  ?item a skos:Concept . 
   ?URI skos:broaderTransitive ?item .
}

9

List of concepts skos:narrowerTransitive than the concept identified by URI
SELECT ?item 
WHERE {
  ?item a skos:Concept . 
   {URI} skos:narrowerTransitive ?item .
}

10

List of concepts skos:broader than a concept with a label that matches this text
SELECT ?item 
WHERE {
  ?item a skos:Concept . 
   ?i0 skos:broader ?item . 
   ?i0 ?label ?l . 
   FILTER ( ?label = rdfs:label || ?label = skos:prefLabel || ?label = skos:altLabel ) 
   FILTER ( ?l = {text}@en )
}

11

List of concepts skos:narrower than a concept with a label that matches this text
SELECT ?item 
WHERE {
  ?item a skos:Concept . 
   ?i0 skos:narrower ?item . 
   ?i0 ?label ?l . 
   FILTER ( ?label = rdfs:label || ?label = skos:prefLabel || ?label = skos:altLabel ) 
   FILTER ( ?l = {text}@en )
}

12

List of concepts skos:broaderTransitive than a concept with a label that matches this text
SELECT ?item 
WHERE {
  ?item a skos:Concept . 
   ?i0 skos:broaderTransitive ?item . 
   ?i0 ?label ?l . 
   FILTER ( ?label = rdfs:label || ?label = skos:prefLabel || ?label = skos:altLabel ) 
   FILTER ( ?l = {text}@en )
}

13

List of concepts skos:narrowerTransitive than a concept with a label that matches this text
SELECT ?item 
WHERE {
  ?item a skos:Concept . 
   ?i0 skos:narrowerTransitive ?item . 
   ?i0 ?label ?l . 
   FILTER ( ?label = rdfs:label || ?label = skos:prefLabel || ?label = skos:altLabel ) 
   FILTER ( ?l = {text}@en )
}

Note: whitespace inside {text} must be escaped. Each single space may be replaced by "+".

Note: Operations should not extrapolate semantics. 'broader' is a separate operation to 'broaderTransitive'.

Note: the triple-store behind the interface might have a reasoner allowing some semantic relations to be inferred. Else the SKOS properties should all be precomputed, esp. *transitive.

Note: uri={URI} requires that special characters in the value of {URI} are percent-encoded. The simplest rule is to encode all non-alpha characters. Note, however, that the URI itself provides more direct access, and is the preferred interface.

Note: VocAPI uses SKOS types and properties in query patterns implemented in SPARQL. The vocabulary contents can also include statements using other namespaces, and these triples will be reported in query results, but are not available for query parameterization.-- SimonCox - 11 Jan 2012
Topic revision: r7 - 16 Mar 2012, SimonCox
 

Current license: All material on this collaboration platform is licensed under a Creative Commons Attribution 3.0 Australia Licence (CC BY 3.0).