SPARQL Queries useful for DDG

This page contains various SPARQL queries that can be performed on the MICA triplestore in order to provide useful information in the DDG interface.

Queries are sorted according to the type of resource to which they relate.

Concepts centric queries (TOC)

Get top level domain concepts (top level concepts in MICA main ontology)

Theses concepts are the concepts that have micavocab:MICA as parent concept.

Select all concepts which have micavocab:MICA as parent and for these concepts give the URI and label

PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX micavocab: <https://w3id.org/mica/ontology/MicaOntology/>

SELECT ?conceptURI ?label
WHERE {
    ?conceptURI a skos:Concept;
              skos:prefLabel ?label;
              skos:broader micavocab:MICA.
}
order by ?label

Get direct subconcepts of a given concept

In fact the previous query can be generalized to find all the direct sub-concepts of any given concept. For example :

Select all concepts which have micavocab:0491ee9f6cf74dcda7ab92db86284c05 as parent and for these concepts give the URI and label

PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX micavocab: <https://w3id.org/mica/ontology/MicaOntology/>

SELECT ?conceptURI ?label
WHERE {
    ?conceptURI a skos:Concept;
              skos:prefLabel ?label;
              skos:broader micavocab:0491ee9f6cf74dcda7ab92db86284c05.
}
order by ?label

The previous query uses the skos:broader relation to retrieve the sub-concepts. It's also possible to uses the inverse relation skos:narrower.

PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX micavocab: <https://w3id.org/mica/ontology/MicaOntology/>

SELECT ?conceptURI ?label
WHERE {
   ?conceptURI a skos:Concept;
              skos:prefLabel ?label.
    micavocab:0491ee9f6cf74dcda7ab92db86284c05 skos:narrower ?conceptURI.
}
order by ?label

Get direct parent concept of a given concept

e.g. parent of concept micavocab:0491ee9f6cf74dcda7ab92db86284c05

PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX micavocab: <https://w3id.org/mica/ontology/MicaOntology/>

SELECT   ?conceptURI  ?label
WHERE {
   ?conceptURI a skos:Concept;
               skos:prefLabel ?label .
    micavocab:0491ee9f6cf74dcda7ab92db86284c05 skos:broader ?conceptURI.
 }
order by ?label

The same query using skos:narrower instead of skos:broader

PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX micavocab: <https://w3id.org/mica/ontology/MicaOntology/>

SELECT   ?conceptURI  ?label
WHERE {
     ?conceptURI a skos:Concept;
                skos:narrower micavocab:0491ee9f6cf74dcda7ab92db86284c05;
                skos:prefLabel ?label .
 }
order by ?label

Get all concepts of a given Concept scheme

e.g. Select all concepts of micavocab:DomainScheme

PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX micavocab: <https://w3id.org/mica/ontology/MicaOntology/>

SELECT ?conceptURI ?label 
WHERE {
   ?conceptURI a skos:Concept;
              skos:prefLabel ?label;
              skos:inScheme micavocab:DomainScheme.
  }
order by ?label

to get all the concepts of a concept scheme other than domain scheme just replace micavocab:DomainScheme URI by the corresponding MICA scheme URI.

  • micavocab:CommodityScheme for commodity concepts
  • micavocab:DataScheme for data concepts
  • micavocab:MethodScheme for method concepts
  • micavocab:SpatialScheme for spatial concepts
  • micavocab:TemporalScheme for temporal concepts
  • micavocab:ValueSupplyChainScheme for value supply chain concepts

Get statistics by concept

To get all statistics about a given concept ( all types of sheets directly or undirectly related to a given conceptURI. micavocab:0491ee9f6cf74dcda7ab92db86284c05

PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#>
PREFIX micavocab: <https://w3id.org/mica/ontology/MicaOntology/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>

SELECT (count (DISTINCT ?methodURI) as ?methodsNb)
       (count (DISTINCT ?documentationURI) as ?documentationNb)
       (count (DISTINCT ?legislationURI) as ?legislationNb)
       (count (DISTINCT ?dataURI) as ?dataNb)
       (count (DISTINCT ?portalURI) as ?portalNb)
       (count (DISTINCT ?articleURI) as ?articleNb)
       (count (DISTINCT ?otherURI) as ?otherNb)
       (count (DISTINCT ?flowsheetURI) as ?flowsheetNb)
       (count (DISTINCT ?questionURI) as ?questionNb)

WHERE {
  {
    ?methodURI micamodel:hasContentType micamodel:MethodsAndTools;
                ?hasMicaConcept ?d.
    ?d skos:broaderTransitive micavocab:0491ee9f6cf74dcda7ab92db86284c05 .
  }
  union {
      ?documentationURI micamodel:hasContentType micamodel:Documentation;
                ?hasMicaConcept ?d.
    ?d skos:broaderTransitive micavocab:0491ee9f6cf74dcda7ab92db86284c05 .
  }
  union {
     ?legislationURI micamodel:hasContentType micamodel:Legislation;
                ?hasMicaConcept ?d.
    ?d skos:broaderTransitive micavocab:0491ee9f6cf74dcda7ab92db86284c05 .
  }
  union {
     ?dataURI micamodel:hasContentType micamodel:Data;
                ?hasMicaConcept ?d.
    ?d skos:broaderTransitive micavocab:0491ee9f6cf74dcda7ab92db86284c05 .
  }
 union {
     ?portalURI micamodel:hasContentType micamodel:Portal;
               ?hasMicaConcept ?d.
    ?d skos:broaderTransitive micavocab:0491ee9f6cf74dcda7ab92db86284c05 .
  }
 union {
     ?articleURI micamodel:hasContentType micamodel:ArticlesAndReports;
                ?hasMicaConcept ?d.
    ?d skos:broaderTransitive micavocab:0491ee9f6cf74dcda7ab92db86284c05 .
  }
 union {
     ?otherURI micamodel:hasContentType micamodel:Other;
                ?hasMicaConcept ?d.
    ?d skos:broaderTransitive micavocab:0491ee9f6cf74dcda7ab92db86284c05 .
  }
 union {
     ?flowSheetURI a micamodel:FlowSheet;
                ?hasMicaConcept ?d.
    ?d skos:broaderTransitive micavocab:0491ee9f6cf74dcda7ab92db86284c05 .
  }
 union {
     ?questionURI a micamodel:MICAQuestion;
                ?hasMicaConcept ?d.
    ?d skos:broaderTransitive micavocab:0491ee9f6cf74dcda7ab92db86284c05 .
  }
}

Get all sheets of a given type directly related to a given concept

Select all Methods and Tools sheets (URI and title) directly related to domain concept micavocab:0491ee9f6cf74dcda7ab92db86284c05

PREFIX micavocab: <https://w3id.org/mica/ontology/MicaOntology/>
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#>
PREFIX dcterms: <http://purl.org/dc/terms/>

SELECT ?sheetURI ?title
WHERE {
      ?sheetURI a micamodel:Sheet;
                micamodel:hasContentType micamodel:MethodsAndTools;
                dcterms:title ?title;
                ?hasMicaConcept micavocab:0491ee9f6cf74dcda7ab92db86284c05 .
}
order by ?title

For other types of content (Documentation, Legislation, Data, Portal,Articles & Reports, Other) just replace micamodel:MethodsAndTools in the previous query by the corresponding data type defined in MicaModel ontology.

Get all sheets of a given type related to a given concept (directly or undirectly i.e. through subconcepts)

e.g. find all Methods and Tools sheets (URI, title ) related (directly or undirectly through subconcepts) to the concept micavocab:0491ee9f6cf74dcda7ab92db86284c05

PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX micavocab: <https://w3id.org/mica/ontology/MicaOntology/>
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#>
PREFIX dcterms: <http://purl.org/dc/terms/>

SELECT distinct ?sheetURI ?title 
WHERE {
    ?sheetURI a micamodel:Sheet;
             micamodel:hasContentType micamodel:MethodsAndTools;
             dcterms:title ?title;
             ?hasMicaConcept ?d.
    ?d skos:broaderTransitive micavocab:0491ee9f6cf74dcda7ab92db86284c05 .      
}
order by ?title

To search for an other type of content (e.g. Documentation) just replace micamodel:MethodsAndTools by the appropriate corresponding type defined in types of content .

Get all flowsheets related to a given concept

Select all flowSheets (URI and title) directly related to a given concept micavocab:0491ee9f6cf74dcda7ab92db86284c05.

PREFIX micavocab: <https://w3id.org/mica/ontology/MicaOntology/>
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#>
PREFIX dcterms: <http://purl.org/dc/terms/>

SELECT ?flowSheetURI ?title
WHERE {
      ?flowSheetURI a micamodel:FlowSheet;
                dcterms:title ?title;
                ?hasMicaConcept micavocab:0491ee9f6cf74dcda7ab92db86284c05 .
}
order by ?title

Select all flowSheets (URI and title) directly or undirectly (i.e. through subconcepts) related to a given concept micavocab:0491ee9f6cf74dcda7ab92db86284c05.

PREFIX micavocab: <https://w3id.org/mica/ontology/MicaOntology/>
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#>
PREFIX dcterms: <http://purl.org/dc/terms/>

SELECT distinct ?flowSheetURI ?title
WHERE {
      ?flowSheetURI a micamodel:FlowSheet;
                dcterms:title ?title;
                 ?hasMicaConcept ?d.
    ?d skos:broaderTransitive micavocab:0491ee9f6cf74dcda7ab92db86284c05 .
}
order by ?title

Get all questions related to a given concept

e.g. get all questions (URI , description) directly related to the a given concept micavocab:0491ee9f6cf74dcda7ab92db86284c05

PREFIX micavocab: <https://w3id.org/mica/ontology/MicaOntology/>
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#>

SELECT  ?questionURI ?question
WHERE {
      ?questionURI a micamodel:MICAQuestion;
                micamodel:question ?question;
                ?hasMicaConcept micavocab:0491ee9f6cf74dcda7ab92db86284c05 .
}
order by ?question

e.g. get all questions (URI , description) directly or undirectly (i.e. through subconcepts) related to the a given concept micavocab:0491ee9f6cf74dcda7ab92db86284c05

PREFIX micavocab: <https://w3id.org/mica/ontology/MicaOntology/>
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#>

SELECT distinct ?questionURI ?question
WHERE {
      ?questionURI a micamodel:MICAQuestion;
                micamodel:question ?question;
                ?hasMicaConcept ?d.
    ?d skos:broaderTransitive micavocab:0491ee9f6cf74dcda7ab92db86284c05 .
}
order by ?question

Get all concepts of a given concept scheme related to a given concept .

Main ontology (domain) concepts and tranversal ontologies concepts are defined in different concept schemes.

e.g. get all domain concepts (URI , label) related to the concept micavocab:0491ee9f6cf74dcda7ab92db86284c05

PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX micavocab: <https://w3id.org/mica/ontology/MicaOntology/>

SELECT ?conceptURI ?label
WHERE {
    ?conceptURI a skos:Concept;
                skos:prefLabel ?label;
                skos:inScheme micavocab:DomainScheme;
                skos:related micavocab:0491ee9f6cf74dcda7ab92db86284c05.
}
order by ?label

to get all the concepts of a concept scheme other than domain scheme just replace micavocab:DomainScheme URI by the corresponding MICA scheme URI.

  • micavocab:CommodityScheme for commodity concepts
  • micavocab:DataScheme for data concepts
  • micavocab:MethodScheme for methods concepts
  • micavocab:SpatialScheme for spatial concepts
  • micavocab:TemporalScheme for temporal concepts
  • micavocab:ValueSupplyChainScheme for value supply chain concepts

e.g. get all commodity concepts (URI , label) related to the domain concept micavocab:0491ee9f6cf74dcda7ab92db86284c05

PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX micavocab: <https://w3id.org/mica/ontology/MicaOntology/>

SELECT ?conceptURI ?label
WHERE {
   ?conceptURI a skos:Concept;
               skos:prefLabel ?label;
               skos:inScheme micavocab:CommodityScheme;
               skos:related micavocab:0491ee9f6cf74dcda7ab92db86284c05.
}
order by ?label

Get metadata (label definition, description, links …) for a given concept

e.g. find URI, label and if they exist the definition and alternative labels of the domain concept micavocab:0491ee9f6cf74dcda7ab92db86284c05

PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX micavocab: <https://w3id.org/mica/ontology/MicaOntology/>

SELECT ?label ?definition ?altLabel ?scheme ?uriSame
(group_concat(distinct ?broaderURI; separator = ";") AS ?broaderURIs)
(group_concat(distinct ?narrowerURI; separator = ";") AS ?narrowerURIs)
(group_concat(distinct ?relatedURI; separator = ";") AS ?relatedURIs)
   
WHERE {
    micavocab:0491ee9f6cf74dcda7ab92db86284c05 skos:prefLabel ?label.
    optional { micavocab:0491ee9f6cf74dcda7ab92db86284c05 skos:definition ?definition.}
    optional { micavocab:0491ee9f6cf74dcda7ab92db86284c05 skos:altLabel ?altLabel.}
    optional { micavocab:0491ee9f6cf74dcda7ab92db86284c05 skos:inScheme ?scheme.}
    optional { micavocab:0491ee9f6cf74dcda7ab92db86284c05 owl:sameAs ?uriSame.}
    optional { micavocab:0491ee9f6cf74dcda7ab92db86284c05 skos:broader ?broaderURI.}
    optional { micavocab:0491ee9f6cf74dcda7ab92db86284c05 skos:narrower ?narrowerURI.}
    optional { micavocab:0491ee9f6cf74dcda7ab92db86284c05 skos:related ?relatedURI.}
}
group by ?label ?definition ?altLabel ?scheme ?uriSame

Get all concepts containing a text in their label or definition or other available metadata

e.g. find URI, label and if they exist the definition and alternative labels of all the concepts containing the text "drilling"

PREFIX skos: <http://www.w3.org/2004/02/skos/core#>

SELECT    ?conceptURI ?label ?definition ?altLabel
WHERE {
    ?conceptURI a skos:Concept;
           skos:prefLabel ?label.
    FILTER regex( ?label ,"drilling","i")
    optional{
       ?conceptURI skos:definition ?definition.
       FILTER regex( ?definition ,"drilling","i")
    }  
    optional{
       ?conceptURI skos:altLabel ?altLabel.
       FILTER regex( ?altLabel ,"drilling","i")
    } 
}
order by ?label

Sheets centric queries (TOC)

Sheets can be of any type of MICAContentType MethodsAndTools, Documentation, Legislation... See MicaModel ontology.

Get all sheets of a given type of content

e.g. get all Methods and Tools (URI and title)

PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#>
PREFIX dcterms: <http://purl.org/dc/terms/>

SELECT ?sheetURI ?title
WHERE {
    ?sheetURI a micamodel:Sheet;
              micamodel:hasContentType micamodel:MethodsAndTools;
              dcterms:title ?title.
}
order by ?title

For other type of content just replace micamodel:MethodsAndTools by the appropriate MicaModel ontology type. see types of content .

Get all sheets related to a given sheet

e.g. find all Methods and Tools related to the sheet micaresource:3928d0113e70425a8d26212e7db52247

PREFIX micaresource: <https://w3id.org/mica/resource/>
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#>
PREFIX dcterms: <http://purl.org/dc/terms/>

SELECT ?sheetURI ?title
WHERE {
       ?sheetURI a micamodel:Sheet;
                 dcterms:title ?title;
                 micamodel:hasContentType micamodel:MethodsAndTools;
                 micamodel:relatedTo micaresource:3928d0113e70425a8d26212e7db52247. 
}
order by ?title

For other type of sheets just replace micamodel:MethodsAndTools by the appropriate MicaModel ontology data type. see types of content .

Get all questions related to a given sheet

eg get all the questions (URI and question) related to the sheet micaresource:3928d0113e70425a8d26212e7db52247

PREFIX micaresource: <https://w3id.org/mica/resource/>
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#>

SELECT ?questionURI ?question
WHERE {
    ?questionURI a micamodel:MICAQuestion;
              micamodel:question ?question;
              micamodel:relatedTo micaresource:3928d0113e70425a8d26212e7db52247.  
}
order by  ?question

Get all the flowsheets related to a given sheet

eg get all the flowsheets (URI and title) related to the sheet micaresource:3928d0113e70425a8d26212e7db52247

PREFIX micaresource: <https://w3id.org/mica/resource/>
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#>
PREFIX dcterms: <http://purl.org/dc/terms/>

SELECT ?flowsheetURI ?title
WHERE {
    ?flowsheetURI a micamodel:FlowSheet;
              dcterms:title ?title;
              micamodel:relatedTo micaresource:3928d0113e70425a8d26212e7db52247.  
}

Get all concepts related to a given sheet

e.g. get all concepts (URI and label) related to the sheet micaresource:3928d0113e70425a8d26212e7db52247

PREFIX micaresource: <https://w3id.org/mica/resource/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#>

SELECT ?conceptURI ?label ?hasMicaConcept
WHERE {
    micaresource:3928d0113e70425a8d26212e7db52247  ?hasMicaConcept ?conceptURI .
    ?conceptURI a skos:Concept;
            skos:prefLabel ?label.  
}

Get metadata (label definition, description, links …) for a given sheet

e.g. find URI, label and if they exist the definition and alternative labels of a given sheet micaresource:3928d0113e70425a8d26212e7db52247

PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX micavocab: <https://w3id.org/mica/ontology/MicaOntology/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#>

SELECT ?title ?summary ?publicURI 
(group_concat(distinct ?micaResourceURI; separator = ";") AS ?micaResourceURIs)
(group_concat(distinct ?conceptURI; separator = ";") AS ?conceptURIs)
   
WHERE {
    micaresource:3928d0113e70425a8d26212e7db52247  dcterms:title ?title;
                                       micamodel:summary ?summary;
                                       micamodel:publicURI ?publicURI;
    optional { micaresource:3928d0113e70425a8d26212e7db52247 micamodel:relatedTo ?micaResourceURI.}
    optional { micaresource:3928d0113e70425a8d26212e7db52247 ?hasMicaConcept ?conceptURI.}
  }
group by ?title ?summary ?publicURI

Get statistics by sheet

To get all statistics about a given sheet. For a given sheetURI. micaresource:3928d0113e70425a8d26212e7db52247

PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#>
PREFIX micavocab: <https://w3id.org/mica/ontology/MicaOntology/>
PREFIX micaresource: <https://w3id.org/mica/resource/>

SELECT (count (DISTINCT ?methodURI) as ?methodsNb)
       (count (DISTINCT ?documentationURI) as ?documentationNb)
       (count (DISTINCT ?legislationURI) as ?legislationNb)
       (count (DISTINCT ?dataURI) as ?dataNb)
       (count (DISTINCT ?portalURI) as ?portalNb)
       (count (DISTINCT ?articleURI) as ?articleNb)
       (count (DISTINCT ?otherURI) as ?otherNb)
       (count (DISTINCT ?flowsheetURI) as ?flowsheetNb)
       (count (DISTINCT ?questionURI) as ?questionNb)

WHERE {
  {
    ?methodURI micamodel:relatedTo micaresource:3928d0113e70425a8d26212e7db52247;
            micamodel:hasContentType micamodel:MethodsAndTools.
  }
  union {
      ?documentationURI micamodel:relatedTo micaresource:3928d0113e70425a8d26212e7db52247;
                        micamodel:hasContentType micamodel:Documentation.
  }
  union {
     ?legislationURI micamodel:relatedTo micaresource:3928d0113e70425a8d26212e7db52247;
                     micamodel:hasContentType micamodel:Legislation.
  }
  union {
     ?dataURI micamodel:relatedTo micaresource:3928d0113e70425a8d26212e7db52247;
              micamodel:hasContentType micamodel:Data.
  }
 union {
     ?portalURI micamodel:relatedTo micaresource:3928d0113e70425a8d26212e7db52247;
                micamodel:hasContentType micamodel:Portal.
  }
 union {
     ?articleURI micamodel:relatedTo micaresource:3928d0113e70425a8d26212e7db52247;
                 micamodel:hasContentType micamodel:ArticlesAndReports.
  }
 union {
     ?otherURI micamodel:relatedTo micaresource:3928d0113e70425a8d26212e7db52247;
               micamodel:hasContentType micamodel:Other.
  }
 union {
     ?flowSheetURI micamodel:relatedTo micaresource:3928d0113e70425a8d26212e7db52247;
                   a micamodel:FlowSheet.
  }
 union {
     ?questionURI micamodel:relatedTo micaresource:3928d0113e70425a8d26212e7db52247;
                   a micamodel:MICAQuestion.
  }
}

Get all sheets of a given type containing a text in their title or summary or other available metadata.

e.g. find all Methods and Tools (URI, title and summary) containing the text "de"

prefix micamodel: <https://w3id.org/mica/ontology/MicaModel#>
prefix dcterms: <http://purl.org/dc/terms/>

SELECT ?sheetURI ?title ?summary
WHERE {
    ?sheetURI a micamodel:Sheet;
              dcterms:title ?title;
              micamodel:hasContentType micamodel:MethodsAndTools;
              FILTER regex( ?title ,"de","i")
              micamodel:summary ?summary.
              FILTER regex( ?summary ,"de","i")    
}

For other type of sheets just replace micamodel:MethodsAndTools by the appropriate MicaModel ontology data type. see types of content .


FlowSheets centric queries (TOC)

FlowSheets is an ordered list of Sheets MicaModel FlowSheet.

Get all FlowSheets

e.g. get all flowSheets(URI and title)

PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#>
PREFIX dcterms: <http://purl.org/dc/terms/>

SELECT ?flowsheetURI ?title
WHERE {
    ?flowsheetURI a micamodel:FlowSheet;
                  dcterms:title ?title.
}

Get all MICAKnowledgeElements belonging in FlowSheet

prefix micaresource: <https://w3id.org/mica/resource/> 
prefix micamodel: <https://w3id.org/mica/ontology/MicaModel#>
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

SELECT ?micaKnowledgeElementURI ?role
WHERE {
  micaresource:b86f2a6a40414626889222fbff4d9305 micamodel:hasElements/rdf:rest*/rdf:first ?element.
               ?element micamodel:role ?role;
               micamodel:hasKnowledgeElement ?micaKnowledgeElementURI.
}

Get all sheets related to a given FlowSheet

e.g. find all Methods and Tools related to the sheet micaresource:b86f2a6a40414626889222fbff4d9305

PREFIX micaresource: <https://w3id.org/mica/resource/>
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#>
PREFIX dcterms: <http://purl.org/dc/terms/>

SELECT ?sheetURI ?title
WHERE {
       ?sheetURI a micamodel:Sheet;
                 dcterms:title ?title;
                 micamodel:hasContentType micamodel:MethodsAndTools;
                 micamodel:relatedTo micaresource:b86f2a6a40414626889222fbff4d9305. 
}

For other type of sheets just replace micamodel:MethodsAndTools by the appropriate MicaModel ontology data type. see types of content .

Get all questions related to a given FlowSheet

eg get all the questions (URI and question) related to the FlowSheet micaresource:b86f2a6a40414626889222fbff4d9305

PREFIX micaresource: <https://w3id.org/mica/resource/>
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#>

SELECT ?questionURI ?question
WHERE {
    ?questionURI a micamodel:MICAQuestion;
              micamodel:question ?question;
              micamodel:relatedTo micaresource:b86f2a6a40414626889222fbff4d9305.  
}

Get all the flowsheets related to a given sheet

eg get all the flowsheets (URI and title) related to the FlowSheet micaresource:b86f2a6a40414626889222fbff4d9305

PREFIX micaresource: <https://w3id.org/mica/resource/>
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#>
PREFIX dcterms: <http://purl.org/dc/terms/>

SELECT ?flowsheetURI ?title
WHERE {
    ?flowsheetURI a micamodel:FlowSheet;
              dcterms:title ?title;
              micamodel:relatedTo micaresource:b86f2a6a40414626889222fbff4d9305.  
}

Get all concepts related to a given sheet

e.g. get all concepts (URI and label) related to the FlowSheet micaresource:b86f2a6a40414626889222fbff4d9305

PREFIX micaresource: <https://w3id.org/mica/resource/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#>

SELECT ?conceptURI ?label ?hasMicaConcept
WHERE {
    micaresource:b86f2a6a40414626889222fbff4d9305  ?hasMicaConcept ?conceptURI .
    ?conceptURI a skos:Concept;
            skos:prefLabel ?label.  
}

Get metadata (label definition, description, links …) for a given FlowSheet

e.g. find URI, label and if they exist the definition and alternative labels of a given sheet micaresource:b86f2a6a40414626889222fbff4d9305

PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX micavocab: <https://w3id.org/mica/ontology/MicaOntology/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#>

SELECT ?title ?summary 
(group_concat(distinct ?micaResourceURI; separator = ";") AS ?micaResourceURIs)
(group_concat(distinct ?conceptURI; separator = ";") AS ?conceptURIs)
   
WHERE {
    micaresource:b86f2a6a40414626889222fbff4d9305  dcterms:title ?title;
                                       micamodel:summary ?summary;
    optional { micaresource:b86f2a6a40414626889222fbff4d9305 micamodel:relatedTo ?micaResourceURI.}
    optional { micaresource:b86f2a6a40414626889222fbff4d9305 ?hasMicaConcept ?conceptURI.}
  }
group by ?title ?summary 

Get statistics by FlowSheet

To get all statistics about a given sheet. For a given sheetURI. micaresource:b86f2a6a40414626889222fbff4d9305

PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#>
PREFIX micavocab: <https://w3id.org/mica/ontology/MicaOntology/>
PREFIX micaresource: <https://w3id.org/mica/resource/>

SELECT (count (DISTINCT ?methodURI) as ?methodsNb)
       (count (DISTINCT ?documentationURI) as ?documentationNb)
       (count (DISTINCT ?legislationURI) as ?legislationNb)
       (count (DISTINCT ?dataURI) as ?dataNb)
       (count (DISTINCT ?portalURI) as ?portalNb)
       (count (DISTINCT ?articleURI) as ?articleNb)
       (count (DISTINCT ?otherURI) as ?otherNb)
       (count (DISTINCT ?flowsheetURI) as ?flowsheetNb)
       (count (DISTINCT ?questionURI) as ?questionNb)

WHERE {
  {
    ?methodURI micamodel:relatedTo micaresource:b86f2a6a40414626889222fbff4d9305;
            micamodel:hasContentType micamodel:MethodsAndTools.
  }
  union {
      ?documentationURI micamodel:relatedTo micaresource:b86f2a6a40414626889222fbff4d9305;
                        micamodel:hasContentType micamodel:Documentation.
  }
  union {
     ?legislationURI micamodel:relatedTo micaresource:b86f2a6a40414626889222fbff4d9305;
                     micamodel:hasContentType micamodel:Legislation.
  }
  union {
     ?dataURI micamodel:relatedTo micaresource:b86f2a6a40414626889222fbff4d9305;
              micamodel:hasContentType micamodel:Data.
  }
 union {
     ?portalURI micamodel:relatedTo micaresource:b86f2a6a40414626889222fbff4d9305;
                micamodel:hasContentType micamodel:Portal.
  }
 union {
     ?articleURI micamodel:relatedTo micaresource:b86f2a6a40414626889222fbff4d9305;
                 micamodel:hasContentType micamodel:ArticlesAndReports.
  }
 union {
     ?otherURI micamodel:relatedTo micaresource:b86f2a6a40414626889222fbff4d9305;
               micamodel:hasContentType micamodel:Other.
  }
 union {
     ?flowSheetURI micamodel:relatedTo micaresource:b86f2a6a40414626889222fbff4d9305;
                   a micamodel:FlowSheet.
  }
 union {
     ?questionURI micamodel:relatedTo micaresource:b86f2a6a40414626889222fbff4d9305;
                   a micamodel:MICAQuestion.
  }
}

Get all sheets of a given type containing a text in their title or summary or other available metadata.

e.g. find all Methods and Tools (URI, title and summary) containing the text "de"

prefix micamodel: <https://w3id.org/mica/ontology/MicaModel#>
prefix dcterms: <http://purl.org/dc/terms/>

SELECT ?sheetURI ?title ?summary
WHERE {
    ?sheetURI a micamodel:FlowSheet;
              dcterms:title ?title;
              FILTER regex( ?title ,"de","i")
              micamodel:summary ?summary.
              FILTER regex( ?summary ,"de","i")    
}

Questions centric queries (TOC)

Get all questions (URI and description)

 PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#>

 SELECT ?questionURI ?question
 WHERE {
    ?questionURI a micamodel:MICAQuestion;
        micamodel:question ?question.
 }

Get all sheets related to a given question

e.g. get all Methods and Tools (URI and title) related to the question micaresource:1bfc399dfc314a8b81f50cfdf119cc9e

PREFIX micaresource: <https://w3id.org/mica/resource/>
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#>
PREFIX dcterms: <http://purl.org/dc/terms/>

SELECT ?sheetURI ?title 
WHERE {
  ?sheetURI a micamodel:Sheet;
            dcterms:title ?title;
            micamodel:hasContentType micamodel:MethodsAndTools;
            micamodel:relatedTo micaresource:1bfc399dfc314a8b81f50cfdf119cc9e. 
}

For other type of sheets just replace micamodel:MethodsAndTools by the appropriate MicaModel ontology data type. see types of content .

Get all questions related to a given question

PREFIX micaresource: <https://w3id.org/mica/resource/>
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#>

SELECT ?questionURI ?question 
WHERE {
  ?questionURI a micamodel:MICAQuestion;
            micamodel:question  ?question;
            micamodel:relatedTo micaresource:1bfc399dfc314a8b81f50cfdf119cc9e. 
}

Get all flowsheet related to a given question

PREFIX micaresource: <https://w3id.org/mica/resource/>
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#>
PREFIX dcterms: <http://purl.org/dc/terms/>

SELECT ?flowsheetURI  ?title
WHERE {
  ?flowsheetURI a micamodel:FlowSheet;
            dcterms:title ?title;
            micamodel:relatedTo micaresource:1bfc399dfc314a8b81f50cfdf119cc9e. 
}

Get statistics by question

To get all statistics about a given question. For a given questionURI. micaresource:1bfc399dfc314a8b81f50cfdf119cc9e

PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#>
PREFIX micavocab: <https://w3id.org/mica/ontology/MicaOntology/>
PREFIX micaresource: <https://w3id.org/mica/resource/>

SELECT (count (DISTINCT ?methodURI) as ?methodsNb)
       (count (DISTINCT ?documentationURI) as ?documentationNb)
       (count (DISTINCT ?legislationURI) as ?legislationNb)
       (count (DISTINCT ?dataURI) as ?dataNb)
       (count (DISTINCT ?portalURI) as ?portalNb)
       (count (DISTINCT ?articleURI) as ?articleNb)
       (count (DISTINCT ?otherURI) as ?otherNb)
       (count (DISTINCT ?flowsheetURI) as ?flowsheetNb)
       (count (DISTINCT ?questionURI) as ?questionNb)

WHERE {
  {
    ?methodURI micamodel:relatedTo micaresource:1bfc399dfc314a8b81f50cfdf119cc9e;
               micamodel:hasContentType micamodel:MethodsAndTools.
  }
  union {
      ?documentationURI micamodel:relatedTo micaresource:1bfc399dfc314a8b81f50cfdf119cc9e;
                    micamodel:hasContentType micamodel:Documentation.
  }
  union {
     ?legislationURI micamodel:relatedTo micaresource:1bfc399dfc314a8b81f50cfdf119cc9e;
                     micamodel:hasContentType micamodel:Legislation.
  }
  union {
     ?dataURI micamodel:relatedTo micaresource:1bfc399dfc314a8b81f50cfdf119cc9e;
              micamodel:hasContentType micamodel:Data.
  }
 union {
     ?portalURI micamodel:relatedTo micaresource:1bfc399dfc314a8b81f50cfdf119cc9e;
                micamodel:hasContentType micamodel:Portal.
  }
 union {
     ?articleURI micamodel:relatedTo micaresource:1bfc399dfc314a8b81f50cfdf119cc9e;
                 micamodel:hasContentType micamodel:ArticlesAndReports.
  }
 union {
     ?otherURI micamodel:relatedTo micaresource:1bfc399dfc314a8b81f50cfdf119cc9e;
               micamodel:hasContentType micamodel:Other.
  }
 union {
     ?flowSheetURI micamodel:relatedTo micaresource:1bfc399dfc314a8b81f50cfdf119cc9e;
                   a micamodel:FlowSheet.
  }
 union {
     ?questionURI micamodel:relatedTo micaresource:1bfc399dfc314a8b81f50cfdf119cc9e;
                   a micamodel:MICAQuestion.
  }
}

Get all metadata (question, links …) about a given question

e.g. find metadata of a given question micaresource:1bfc399dfc314a8b81f50cfdf119cc9e

PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX micavocab: <https://w3id.org/mica/ontology/MicaOntology/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#>

SELECT ?question
(group_concat(distinct ?micaResourceURI; separator = ";") AS ?micaResourceURIs)
(group_concat(distinct ?conceptURI; separator = ";") AS ?conceptURIs)
   
WHERE {
    micaresource:1bfc399dfc314a8b81f50cfdf119cc9e micamodel:question ?question;
    optional { micaresource:1bfc399dfc314a8b81f50cfdf119cc9e micamodel:relatedTo ?micaResourceURI.}
    optional { micaresource:1bfc399dfc314a8b81f50cfdf119cc9e ?hasMicaConcept ?conceptURI.}
  }
group by ?question

Get all questions containing a given text in their description

e.g. get all questions containing the text "mining waste"

prefix micamodel: <https://w3id.org/mica/ontology/MicaModel#>
prefix dcterms: <http://purl.org/dc/terms/>

SELECT  ?questionURI ?description
WHERE {
 ?questionURI a micamodel:MICAQuestion;
    micamodel:question ?question.
    FILTER regex( ?question ,"mining waste","i")
}

(TOC)