This documentation presents various SPARQL queries that can be performed on the MICA triplestore in order to manage MICA resources.
The purpose of this documentation is to provide elements that can facilitate the writing of the requests necessary to MICASheetsEditor tool.
All the queries presented here respect the new MICA data model. They are sorted according to the type of MICA resource to which they relate.
For better readability of the examples we use "explicit" strings for the local name of resource URIs. For example:
The effective value of this local name can be different, according to the policy adopted for URI generation in the MICASheet Editor (for example using an UUID).
CAUTION: With Fuseki, SPARQL updates queries must be performed on the update SPARQL endpoint that has a different URL than the query endpoint. For example for the testMicaModel dataset on the LIG fuseki server:
http://lig-coin.imag.fr/fuseki/testMicaModel/update
http://lig-coin.imag.fr/fuseki/testMicaModel/query
These queries concern resources of type micamodel:MICASheet.
This example shows a SPARQL query to create a new MICASheet whose URI is https://w3id.org/mica/resource/MS1 and with the following data:
To create such a MICASheet, the SPARQL Update query is the following:
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#> PREFIX dcterms: <http://purl.org/dc/terms/> INSERT DATA { <https://w3id.org/mica/resource/MS1> a micamodel:MICASheet; dcterms:title "MICA Sheet #1"; micamodel:summary "MICA Sheet #1 summary"; micamodel:publicURI "MICASheet1.pdf"; micamodel:privateURI "MICASheet1.docx"; micamodel:hasContentType micamodel:ArticlesAndReports; micamodel:hasWriter <https://w3id.org/mica/resource/Cassard>, <https://w3id.org/mica/resource/Tertre>; micamodel:hasDomainConcept <https://w3id.org/mica/ontology/MicaOntology/32831dae9fc247f390f1362bee1dcd76>, <https://w3id.org/mica/ontology/MicaOntology/e2badc7277b344abb4b45d794c20a313>; micamodel:hasMethodConcept <https://w3id.org/mica/ontology/MicaOntology/12bebe7935734e829fa772a0c4162900>; micamodel:relatedTo <https://w3id.org/mica/resource/S1>, <https://w3id.org/mica/resource/S2>, <https://w3id.org/mica/resource/S3>; }
To update an existing MICASheet, proceed in two steps:
For example for update the MS1 MICASheet created in the previous example by changing its summary (replace "MICA Sheet #1 summary" by "MICA Sheet #1 new summary" and add a new related MICAResource (S4)
The queries will be:
DELETE { <https://w3id.org/mica/resource/MS1> ?p ?o. } WHERE { <https://w3id.org/mica/resource/MS1> ?p ?o. }
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#> PREFIX dcterms: <http://purl.org/dc/terms/> INSERT DATA { <https://w3id.org/mica/resource/MS1> a micamodel:MICASheet; dcterms:title "MICA Sheet #1"; micamodel:summary "MICA Sheet #1 new summary"; micamodel:publicURI "MICASheet1.pdf"; micamodel:privateURI "MICASheet1.docx"; micamodel:hasContentType micamodel:ArticlesAndReports; micamodel:hasWriter <https://w3id.org/mica/resource/Cassard>, <https://w3id.org/mica/resource/Tertre>; micamodel:hasDomainConcept <https://w3id.org/mica/ontology/MicaOntology/32831dae9fc247f390f1362bee1dcd76>, <https://w3id.org/mica/ontology/MicaOntology/e2badc7277b344abb4b45d794c20a313>; micamodel:hasMethodConcept <https://w3id.org/mica/ontology/MicaOntology/12bebe7935734e829fa772a0c4162900>; micamodel:relatedTo <https://w3id.org/mica/resource/S1>, <https://w3id.org/mica/resource/S2>, <https://w3id.org/mica/resource/S3>, <https://w3id.org/mica/resource/S4>; }
When a MICASheet is deleted all the triples with this MICASheet URI as subject or as object must be removed. from the MICA triple store. In addition to that, if the MICASheet is used in one or several flowsheets, it must be removed from the elements lists of these FlowSheets. All the triples defining the FlowSheetElements referencing the deleted MICASheet must be removed and the triples defining the elements listed of the FlowSheets must be updated.
For example to delete MS1 MICASheet, the query is:
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> DELETE { <https://w3id.org/mica/resource/MS1> ?p ?o. ?otherResource micamodel:relatedTo <https://w3id.org/mica/resource/MS1>. ?element micamodel:hasKnowledgeElement <https://w3id.org/mica/resource/MS1>; micamodel:role ?role. ?node rdf:first ?element; rdf:rest ?rest. ?previousNode ?property ?node. } INSERT { ?previousNode ?property ?rest. } WHERE { <https://w3id.org/mica/resource/MS1> ?p ?o; OPTIONAL { ?otherResource micamodel:relatedTo <https://w3id.org/mica/resource/MS1>. } OPTIONAL { ?element micamodel:hasKnowledgeElement <https://w3id.org/mica/resource/MS1>; micamodel:role ?role. ?node rdf:first ?element; rdf:rest ?rest. ?previousNode ?property ?node. } }
The following queries retrieve information associated to a given MICASheet. Two options are available depending on the type of information retrieved from the resources associated with the sheet:
To display information in the UI, the second option may be more appropriate than the first . This avoids making new queries using the related resources URIs to obtain displayable information.
Of course, according to the needs of the application, a combination of these two solutions can be performed.
The following query retrieves all the information directly associated to a given sheet identified by its URI. In other words it retrieves all the values of the triples <sheetURI predicate object> where:
In order to facilitate its exploitation, the ResultSet contains only one line and when there are multiple values for a given predicate, they are concatenated into a String and separated by a comma.
For example if the sheet has one title and multiple Domain concepts annotations the following query
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#> PREFIX dcterms: <http://purl.org/dc/terms/> SELECT ?title (group_concat(distinct ?domain; separator = ",") AS ?domains) WHERE { <https://w3id.org/mica/resource/45bc4f322c794ca6adbf521a3c64d45e> dcterms:title ?title; micamodel:hasDomainConcept ?domain. } GROUP BY ?title
gives the ResultSet
title | domains |
"Circular Economy defsheet"@en | "https://w3id.org/mica/ontology/MicaOntology/a0ecbc56233b4245b57aa997fe1ea1a1, https://w3id.org/mica/ontology/MicaOntology/20c7030f1bfd41508c57ebee0962caf2" |
The ?domains variable is a String concatenating all the domains Concepts URIs the Sheet is related to, separated by a ','.
If we did not use a group_concat aggregation function we would obtain a multiple lines ResultSet as in the following query.
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#> PREFIX dcterms: <http://purl.org/dc/terms/> SELECT ?title ?domain WHERE { <https://w3id.org/mica/resource/45bc4f322c794ca6adbf521a3c64d45e> dcterms:title ?title; micamodel:hasDomainConcept ?domain. }
the ResultSet
title | domain |
"Circular Economy defsheet"@en | https://w3id.org/mica/ontology/MicaOntology/a0ecbc56233b4245b57aa997fe1ea1a1 |
"Circular Economy defsheet"@en | https://w3id.org/mica/ontology/MicaOntology/20c7030f1bfd41508c57ebee0962caf2 |
For example, the complete query to get all the information associated to MS1 MICASheet is as follows
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#> PREFIX dcterms: <http://purl.org/dc/terms/> SELECT DISTINCT ?title ?summary ?contentType ?publicURI ?privateURI (group_concat(DISTINCT ?author; separator = ",") AS ?authors) (group_concat(DISTINCT ?relatedURI; separator = ",") AS ?relatedURIs) (group_concat(DISTINCT ?domain; separator = ",") AS ?domains) (group_concat(DISTINCT ?method; separator = ",") AS ?methods) (group_concat(DISTINCT ?spatial; separator = ",") AS ?spatials) (group_concat(DISTINCT ?temporal; separator = ",") AS ?temporals) (group_concat(DISTINCT ?commodity; separator = ",") AS ?commodities) (group_concat(DISTINCT ?data; separator = ",") AS ?datas) (group_concat(DISTINCT ?valueSupplyChain; separator = ",") AS ?valueSupplyChains) WHERE { <https://w3id.org/mica/resource/MS1> a micamodel:MICASheet; dcterms:title ?title; micamodel:summary ?summary; micamodel:publicURI ?publicURI; micamodel:hasContentType ?contentType; micamodel:privateURI ?privateURI; micamodel:hasWriter ?author. OPTIONAL{<https://w3id.org/mica/resource/MS1> micamodel:relatedTo ?relatedURI. } OPTIONAL{<https://w3id.org/mica/resource/MS1> micamodel:hasDomainConcept ?domain. } OPTIONAL{<https://w3id.org/mica/resource/MS1> micamodel:hasMethodConcept ?method. } OPTIONAL{<https://w3id.org/mica/resource/MS1> micamodel:hasSpatialConcept ?spatial. } OPTIONAL{<https://w3id.org/mica/resource/MS1> micamodel:hasTemporalConcept ?temporal. } OPTIONAL{<https://w3id.org/mica/resource/MS1> micamodel:hasCommodityConcept ?commodity. } OPTIONAL{<https://w3id.org/mica/resource/MS1> micamodel:hasDataConcept ?data. } OPTIONAL{<https://w3id.org/mica/resource/MS1> micamodel:hasValueSupplyChainConcept ?valueSupplyChain. } } group by ?title ?summary ?contentType ?publicURI ?privateURI
Request variables are :
The following query retrieves all the information directly associated to a given sheet identified by its URI. In other words it retrieves all the values of the triples <sheetURI predicate object> where:
If we consider the example above, retrieving a Sheet title and the domain concepts the sheet is annotated with, the ResultSet will be of the following form
title | domains |
"Circular Economy defsheet"@en | "Circular economy,D7 International Reporting" |
instead of
title | domains |
"Circular Economy defsheet"@en | "https://w3id.org/mica/ontology/MicaOntology/a0ecbc56233b4245b57aa997fe1ea1a1, https://w3id.org/mica/ontology/MicaOntology/20c7030f1bfd41508c57ebee0962caf2" |
The complete query to get all the information associated to MS1 Sheet, in a human readable form, is as follows
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#> PREFIX dcterms: <http://purl.org/dc/terms/> PREFIX skos: <http://www.w3.org/2004/02/skos/core#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT DISTINCT ?title ?summary ?contentType ?publicURI ?privateURI (group_concat(DISTINCT ?name; separator = ",") AS ?authors) (group_concat(DISTINCT ?relatedURILabel; separator = ",") AS ?relatedURIs) (group_concat(DISTINCT ?domainLabel; separator = ",") AS ?domains) (group_concat(DISTINCT ?methodLabel; separator = ",") AS ?methods) (group_concat(DISTINCT ?spatialLabel; separator = ",") AS ?spatials) (group_concat(DISTINCT ?temporalLabel; separator = ",") AS ?temporals) (group_concat(DISTINCT ?commodityLabel; separator = ",") AS ?commodities) (group_concat(DISTINCT ?dataLabel; separator = ",") AS ?datas) (group_concat(DISTINCT ?valueSupplyChainLabel; separator = ",") AS ?valueSupplyChains) WHERE { <https://w3id.org/mica/resource/MS1> a micamodel:MICASheet; dcterms:title ?title; micamodel:summary ?summary; micamodel:publicURI ?publicURI; micamodel:hasContentType ?contentType; micamodel:privateURI ?privateURI; micamodel:hasWriter ?author. ?author foaf:givenName ?firstName; foaf:familyName ?lastName. bind(concat(?lastName," ",?firstName) as ?name) OPTIONAL{ <https://w3id.org/mica/resource/MS1> micamodel:relatedTo ?relatedURI. OPTIONAL{?relatedURI dcterms:title ?relatedURILabel.} OPTIONAL{?relatedURI micamodel:question ?relatedURILabel.} } OPTIONAL{ <https://w3id.org/mica/resource/MS1> micamodel:hasDomainConcept ?domain. ?domain skos:prefLabel ?domainLabel. } OPTIONAL{ <https://w3id.org/mica/resource/MS1> micamodel:hasMethodConcept ?method. ?method skos:prefLabel ?methodLabel. } OPTIONAL{ <https://w3id.org/mica/resource/MS1> micamodel:hasSpatialConcept ?spatial. ?spatial skos:prefLabel ?spatialLabel. } OPTIONAL{ <https://w3id.org/mica/resource/MS1> micamodel:hasTemporalConcept ?temporal. ?temporal skos:prefLabel ?temporalLabel. } OPTIONAL{ <https://w3id.org/mica/resource/MS1> micamodel:hasCommodityConcept ?commodity. ?commodity skos:prefLabel ?commodityLabel. } OPTIONAL{ <https://w3id.org/mica/resource/MS1> micamodel:hasDataConcept ?data. ?data skos:prefLabel ?dataLabel. } OPTIONAL{ <https://w3id.org/mica/resource/MS1> micamodel:hasValueSupplyChainConcept ?valueSupplyChain. ?valueSupplyChain skos:prefLabel ?valueSupplyChainLabel. } } group by ?title ?summary ?contentType ?publicURI ?privateURI
Request variables are :
The following query selects all MICASheets by filtering by a given title text. Each metadata is represented by its label.
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#> PREFIX dcterms: <http://purl.org/dc/terms/> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX skos: <http://www.w3.org/2004/02/skos/core#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT DISTINCT ?uri ?title ?summary ?contentType ?publicURI ?privateURI (group_concat(DISTINCT ?name; separator = ",") AS ?authors) (group_concat(DISTINCT ?relatedURILabel; separator = ",") AS ?relatedURIs) (group_concat(DISTINCT ?domainLabel; separator = ",") AS ?domains) (group_concat(DISTINCT ?methodLabel; separator = ",") AS ?methods) (group_concat(DISTINCT ?spatialLabel; separator = ",") AS ?spatials) (group_concat(DISTINCT ?temporalLabel; separator = ",") AS ?temporals) (group_concat(DISTINCT ?commodityLabel; separator = ",") AS ?commodities) (group_concat(DISTINCT ?dataLabel; separator = ",") AS ?datas) (group_concat(DISTINCT ?valueSupplyChainLabel; separator = ",") AS ?valueSupplyChains) WHERE { ?uri a micamodel:MICASheet; dcterms:title ?title; micamodel:summary ?summary; micamodel:publicURI ?publicURI; micamodel:hasContentType ?contentType; micamodel:privateURI ?privateURI; micamodel:hasWriter ?author. ?author foaf:givenName ?firstName; foaf:familyName ?lastName. bind(concat(?lastName," ",?firstName) as ?name) OPTIONAL{ ?uri micamodel:relatedTo ?relatedURI. OPTIONAL{?relatedURI dcterms:title ?relatedURILabel.} OPTIONAL{?relatedURI micamodel:question ?relatedURILabel.} } OPTIONAL{ ?uri micamodel:hasDomainConcept ?domain. ?domain skos:prefLabel ?domainLabel. } OPTIONAL{ ?uri micamodel:hasMethodConcept ?method. ?method skos:prefLabel ?methodLabel. } OPTIONAL{ ?uri micamodel:hasSpatialConcept ?spatial. ?spatial skos:prefLabel ?spatialLabel. } OPTIONAL{ ?uri micamodel:hasTemporalConcept ?temporal. ?temporal skos:prefLabel ?temporalLabel. } OPTIONAL{ ?uri micamodel:hasCommodityConcept ?commodity. ?commodity skos:prefLabel ?commodityLabel. } OPTIONAL{ ?uri micamodel:hasDataConcept ?data. ?data skos:prefLabel ?dataLabel. } OPTIONAL{ ?uri micamodel:hasValueSupplyChainConcept ?valueSupplyChain. ?valueSupplyChain skos:prefLabel ?valueSupplyChainLabel. } FILTER regex(str(?title), "", "i") } GROUP BY ?uri ?title ?summary ?contentType ?publicURI ?privateURI ORDER BY ?title OFFSET 0 LIMIT 25
Request variables are :
The following query counts all MICASheets by filtering with a given title text.
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#> PREFIX dcterms: <http://purl.org/dc/terms/> SELECT (COUNT ( DISTINCT ?uri) AS ?nbresources) WHERE { ?uri a micamodel:MICASheet; dcterms:title ?title. FILTER regex(str(?title), "", "i") }
Request variables are :
These queries concern resources of type micamodel:LinkedSheet.
Creating a new LinkedSheet whose URI is https://w3id.org/mica/resource/LS1 and with the following data:
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#> PREFIX dcterms: <http://purl.org/dc/terms/> INSERT DATA { <https://w3id.org/mica/resource/LS1> a micamodel:LinkedSheet; dcterms:title "Linked Sheet #1"; micamodel:summary "Linked Sheet #1 summary"; micamodel:publicURI "www.Linked.fr"; micamodel:hasContentType micamodel:MethodsAndTools; micamodel:hasMethodConcept <https://w3id.org/mica/ontology/MicaOntology/12bebe7935734e829fa772a0c4162900>; micamodel:hasDomainConcept <https://w3id.org/mica/ontology/MicaOntology/32831dae9fc247f390f1362bee1dcd76>, <https://w3id.org/mica/ontology/MicaOntology/e2badc7277b344abb4b45d794c20a313>; micamodel:hasWriter <https://w3id.org/mica/resource/Cassard>, <https://w3id.org/mica/resource/Tertre>; micamodel:relatedTo <https://w3id.org/mica/resource/S1>, <https://w3id.org/mica/resource/S2>, <https://w3id.org/mica/resource/S3>; }
To update an existing LinkedSheet, we proceed in two steps:
For example to update LS1) LinkedSheet created in the previous example by changing its title (replace "Linked Sheet #1" by "Linked Sheet New Title#1", removing one author (François Tertre) and by adding a new related MICAResource (S4)
The queries will be:
DELETE { <https://w3id.org/mica/resource/LS1> ?p ?o. } WHERE { <https://w3id.org/mica/resource/LS1> ?p ?o. }
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#> PREFIX dcterms: <http://purl.org/dc/terms/> INSERT DATA { <https://w3id.org/mica/resource/LS1> a micamodel:LinkedSheet; dcterms:title "Linked Sheet New Title #1"; micamodel:summary "Linked Sheet #1 summary"; micamodel:publicURI "www.Linked.fr"; micamodel:hasContentType micamodel:MethodsAndTools; micamodel:hasMethodConcept <https://w3id.org/mica/ontology/MicaOntology/12bebe7935734e829fa772a0c4162900>; micamodel:hasDomainConcept <https://w3id.org/mica/ontology/MicaOntology/32831dae9fc247f390f1362bee1dcd76>, <https://w3id.org/mica/ontology/MicaOntology/e2badc7277b344abb4b45d794c20a313>; micamodel:hasWriter <https://w3id.org/mica/resource/Cassard>; micamodel:relatedTo <https://w3id.org/mica/resource/S1>, <https://w3id.org/mica/resource/S2>, <https://w3id.org/mica/resource/S3>, <https://w3id.org/mica/resource/S4>; }
The following query removes a given LinkedSheet from the MICA triple store. Given the sheet URI, all the triples with this URI as subject or as object are removed. If the LinkedSheet belongs to one or several flowsheets, we remove from the elements lists of these FlowSheets the corresponding FlowSheetElements and delete all the triples defining the FlowSheetElement (role and knowledge element).
For example to delete LS1 LinkedSheet, the query is:
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> DELETE { <https://w3id.org/mica/resource/LS1> ?p ?o. ?otherResource micamodel:relatedTo <https://w3id.org/mica/resource/LS1>. ?element micamodel:hasKnowledgeElement <https://w3id.org/mica/resource/LS1>; micamodel:role ?role. ?node rdf:first ?element; rdf:rest ?rest. ?previousNode ?property ?node. } INSERT { ?previousNode ?property ?rest. } WHERE { <https://w3id.org/mica/resource/LS1> ?p ?o; OPTIONAL { ?otherResource micamodel:relatedTo <https://w3id.org/mica/resource/LS1>. } OPTIONAL { ?element micamodel:hasKnowledgeElement <https://w3id.org/mica/resource/LS1>; micamodel:role ?role. ?node rdf:first ?element; rdf:rest ?rest. ?previousNode ?property ?node. } }
As for MICASheets,two options are available for retrieving queries depending on the type of information retrieved from the resources associated with the LinkedSheet:
For example, the complete query to get all the information associated to LS1 LinkedSheet is as follows
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#> PREFIX dcterms: <http://purl.org/dc/terms/> SELECT DISTINCT ?title ?summary ?contentType ?publicURI (group_concat(DISTINCT ?author; separator = ",") AS ?authors) (group_concat(DISTINCT ?relatedURI; separator = ",") AS ?relatedURIs) (group_concat(DISTINCT ?domain; separator = ",") AS ?domains) (group_concat(DISTINCT ?method; separator = ",") AS ?methods) (group_concat(DISTINCT ?spatial; separator = ",") AS ?spatials) (group_concat(DISTINCT ?temporal; separator = ",") AS ?temporals) (group_concat(DISTINCT ?commodity; separator = ",") AS ?commodities) (group_concat(DISTINCT ?data; separator = ",") AS ?datas) (group_concat(DISTINCT ?valueSupplyChain; separator = ",") AS ?valueSupplyChains) WHERE { <https://w3id.org/mica/resource/LS1> a micamodel:LinkedSheet; dcterms:title ?title; micamodel:summary ?summary; micamodel:publicURI ?publicURI; micamodel:hasContentType ?contentType; micamodel:hasWriter ?author. OPTIONAL{<https://w3id.org/mica/resource/LS1> micamodel:relatedTo ?relatedURI. } OPTIONAL{<https://w3id.org/mica/resource/LS1> micamodel:hasDomainConcept ?domain. } OPTIONAL{<https://w3id.org/mica/resource/LS1> micamodel:hasMethodConcept ?method. } OPTIONAL{<https://w3id.org/mica/resource/LS1> micamodel:hasSpatialConcept ?spatial. } OPTIONAL{<https://w3id.org/mica/resource/LS1> micamodel:hasTemporalConcept ?temporal. } OPTIONAL{<https://w3id.org/mica/resource/LS1> micamodel:hasCommodityConcept ?commodity. } OPTIONAL{<https://w3id.org/mica/resource/LS1> micamodel:hasDataConcept ?data. } OPTIONAL{<https://w3id.org/mica/resource/LS1> micamodel:hasValueSupplyChainConcept ?valueSupplyChain. } } group by ?title ?summary ?contentType ?publicURI
Request variables are :
The complete query to get all the information associated to LS1 Sheet, in a human readable form, is as follows
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#> PREFIX dcterms: <http://purl.org/dc/terms/> PREFIX skos: <http://www.w3.org/2004/02/skos/core#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT DISTINCT ?title ?summary ?contentType ?publicURI (group_concat(DISTINCT ?name; separator = ",") AS ?authors) (group_concat(DISTINCT ?relatedURILabel; separator = ",") AS ?relatedURIs) (group_concat(DISTINCT ?domainLabel; separator = ",") AS ?domains) (group_concat(DISTINCT ?methodLabel; separator = ",") AS ?methods) (group_concat(DISTINCT ?spatialLabel; separator = ",") AS ?spatials) (group_concat(DISTINCT ?temporalLabel; separator = ",") AS ?temporals) (group_concat(DISTINCT ?commodityLabel; separator = ",") AS ?commodities) (group_concat(DISTINCT ?dataLabel; separator = ",") AS ?datas) (group_concat(DISTINCT ?valueSupplyChainLabel; separator = ",") AS ?valueSupplyChains) WHERE { <https://w3id.org/mica/resource/LS1> a micamodel:LinkedSheet; dcterms:title ?title; micamodel:summary ?summary; micamodel:publicURI ?publicURI; micamodel:hasContentType ?contentType; micamodel:hasWriter ?author. ?author foaf:givenName ?firstName; foaf:familyName ?lastName. bind(concat(?lastName," ",?firstName) as ?name) OPTIONAL{ <https://w3id.org/mica/resource/LS1> micamodel:relatedTo ?relatedURI. OPTIONAL{?relatedURI dcterms:title ?relatedURILabel.} OPTIONAL{?relatedURI micamodel:question ?relatedURILabel.} } OPTIONAL{ <https://w3id.org/mica/resource/LS1> micamodel:hasDomainConcept ?domain. ?domain skos:prefLabel ?domainLabel. } OPTIONAL{ <https://w3id.org/mica/resource/LS1> micamodel:hasMethodConcept ?method. ?method skos:prefLabel ?methodLabel. } OPTIONAL{ <https://w3id.org/mica/resource/LS1> micamodel:hasSpatialConcept ?spatial. ?spatial skos:prefLabel ?spatialLabel. } OPTIONAL{ <https://w3id.org/mica/resource/LS1> micamodel:hasTemporalConcept ?temporal. ?temporal skos:prefLabel ?temporalLabel. } OPTIONAL{ <https://w3id.org/mica/resource/LS1> micamodel:hasCommodityConcept ?commodity. ?commodity skos:prefLabel ?commodityLabel. } OPTIONAL{ <https://w3id.org/mica/resource/LS1> micamodel:hasDataConcept ?data. ?data skos:prefLabel ?dataLabel. } OPTIONAL{ <https://w3id.org/mica/resource/LS1> micamodel:hasValueSupplyChainConcept ?valueSupplyChain. ?valueSupplyChain skos:prefLabel ?valueSupplyChainLabel. } } group by ?title ?summary ?contentType ?publicURI
Request variables are :
The following query selects all LinkedSheets by filtering with a given title text. Each metadata is represented by its label.
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#> PREFIX dcterms: <http://purl.org/dc/terms/> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX skos: <http://www.w3.org/2004/02/skos/core#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT DISTINCT ?uri ?title ?summary ?contentType ?publicURI (group_concat(DISTINCT ?name; separator = ",") AS ?authors) (group_concat(DISTINCT ?relatedURILabel; separator = ",") AS ?relatedURIs) (group_concat(DISTINCT ?domainLabel; separator = ",") AS ?domains) (group_concat(DISTINCT ?methodLabel; separator = ",") AS ?methods) (group_concat(DISTINCT ?spatialLabel; separator = ",") AS ?spatials) (group_concat(DISTINCT ?temporalLabel; separator = ",") AS ?temporals) (group_concat(DISTINCT ?commodityLabel; separator = ",") AS ?commodities) (group_concat(DISTINCT ?dataLabel; separator = ",") AS ?datas) (group_concat(DISTINCT ?valueSupplyChainLabel; separator = ",") AS ?valueSupplyChains) WHERE { ?uri a micamodel:LinkedSheet; dcterms:title ?title; micamodel:summary ?summary; micamodel:publicURI ?publicURI; micamodel:hasContentType ?contentType; micamodel:hasWriter ?author. ?author foaf:givenName ?firstName; foaf:familyName ?lastName. bind(concat(?lastName," ",?firstName) as ?name) OPTIONAL{ ?uri micamodel:relatedTo ?relatedURI. OPTIONAL{?relatedURI dcterms:title ?relatedURILabel.} OPTIONAL{?relatedURI micamodel:question ?relatedURILabel.} } OPTIONAL{ ?uri micamodel:hasDomainConcept ?domain. ?domain skos:prefLabel ?domainLabel. } OPTIONAL{ ?uri micamodel:hasMethodConcept ?method. ?method skos:prefLabel ?methodLabel. } OPTIONAL{ ?uri micamodel:hasSpatialConcept ?spatial. ?spatial skos:prefLabel ?spatialLabel. } OPTIONAL{ ?uri micamodel:hasTemporalConcept ?temporal. ?temporal skos:prefLabel ?temporalLabel. } OPTIONAL{ ?uri micamodel:hasCommodityConcept ?commodity. ?commodity skos:prefLabel ?commodityLabel. } OPTIONAL{ ?uri micamodel:hasDataConcept ?data. ?data skos:prefLabel ?dataLabel. } OPTIONAL{ ?uri micamodel:hasValueSupplyChainConcept ?valueSupplyChain. ?valueSupplyChain skos:prefLabel ?valueSupplyChainLabel. } FILTER regex(str(?title), "", "i") } GROUP BY ?uri ?title ?summary ?contentType ?publicURI ORDER BY ?title OFFSET 0 LIMIT 25
Request variables are :
The following query counts all LinkedSheets by filtering with a given title text.
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#> PREFIX dcterms: <http://purl.org/dc/terms/> SELECT (COUNT ( DISTINCT ?uri) AS ?nbresources) WHERE { ?uri a micamodel:LinkedSheet; dcterms:title ?title. FILTER regex(str(?title), "", "i") }
Request variables are :
These queries concern resources of type micamodel:MICAQuestion.
Creating a new MICAQuestion whose URI is https://w3id.org/mica/resource/MQ1 and with the following data:
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#> INSERT DATA { <https://w3id.org/mica/resource/MQ1> a micamodel:MICAQuestion; micamodel:question "MICA Question #1"; micamodel:hasMethodConcept <https://w3id.org/mica/ontology/MicaOntology/12bebe7935734e829fa772a0c4162900>; micamodel:hasDomainConcept <https://w3id.org/mica/ontology/MicaOntology/32831dae9fc247f390f1362bee1dcd76>, <https://w3id.org/mica/ontology/MicaOntology/e2badc7277b344abb4b45d794c20a313>; micamodel:hasWriter <https://w3id.org/mica/resource/Cassard>, <https://w3id.org/mica/resource/Tertre>; micamodel:relatedTo <https://w3id.org/mica/resource/S1>, <https://w3id.org/mica/resource/S2>, <https://w3id.org/mica/resource/S3>; }
To update an existing MICAQuestion, we proceed in two steps:
For example to update MQ1) MICAQuestion created in the previous example by replacing the question text (replace "MICA Question #1" by "MICA New Question #1", removing one author (François Tertre) and by adding a new related MICAResource (S4)
The queries will be:
DELETE { <https://w3id.org/mica/resource/MQ1> ?p ?o. } WHERE { <https://w3id.org/mica/resource/MQ1> ?p ?o. }
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#> INSERT DATA { <https://w3id.org/mica/resource/MQ1> a micamodel:MICAQuestion; micamodel:question "MICA New Question #1"; micamodel:hasMethodConcept <https://w3id.org/mica/ontology/MicaOntology/12bebe7935734e829fa772a0c4162900>; micamodel:hasDomainConcept <https://w3id.org/mica/ontology/MicaOntology/32831dae9fc247f390f1362bee1dcd76>, <https://w3id.org/mica/ontology/MicaOntology/e2badc7277b344abb4b45d794c20a313>; micamodel:hasWriter <https://w3id.org/mica/resource/Cassard>; micamodel:relatedTo <https://w3id.org/mica/resource/S1>, <https://w3id.org/mica/resource/S2>, <https://w3id.org/mica/resource/S3>, <https://w3id.org/mica/resource/S4>; }
The following query removes a given MICAQuestion from the MICA triple store. Given the question URI, all the triples with this URI as subject or as object are removed.
For example to delete MQ1 MICAQuestion, the query is:
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#> DELETE { <https://w3id.org/mica/resource/MQ1> ?p ?o. ?otherResource micamodel:relatedTo <https://w3id.org/mica/resource/MQ1>. } WHERE { <https://w3id.org/mica/resource/MQ1> ?p ?o; OPTIONAL { ?otherResource micamodel:relatedTo <https://w3id.org/mica/resource/MQ1>. } }
As for MICASheets,two options are available for retrieving queries depending on the type of information retrieved from the resources associated with the MICAQuestion:
For example, the complete query to get all the information associated to MQ1 MICAQuestion is as follows
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#> SELECT DISTINCT ?question (group_concat(DISTINCT ?author; separator = ",") AS ?authors) (group_concat(DISTINCT ?relatedURI; separator = ",") AS ?relatedURIs) (group_concat(DISTINCT ?domain; separator = ",") AS ?domains) (group_concat(DISTINCT ?method; separator = ",") AS ?methods) (group_concat(DISTINCT ?spatial; separator = ",") AS ?spatials) (group_concat(DISTINCT ?temporal; separator = ",") AS ?temporals) (group_concat(DISTINCT ?commodity; separator = ",") AS ?commodities) (group_concat(DISTINCT ?data; separator = ",") AS ?datas) (group_concat(DISTINCT ?valueSupplyChain; separator = ",") AS ?valueSupplyChains) WHERE { <https://w3id.org/mica/resource/MQ1> a micamodel:MICAQuestion; micamodel:question ?question; micamodel:hasWriter ?author. OPTIONAL{<https://w3id.org/mica/resource/MQ1> micamodel:relatedTo ?relatedURI. } OPTIONAL{<https://w3id.org/mica/resource/MQ1> micamodel:hasDomainConcept ?domain. } OPTIONAL{<https://w3id.org/mica/resource/MQ1> micamodel:hasMethodConcept ?method. } OPTIONAL{<https://w3id.org/mica/resource/MQ1> micamodel:hasSpatialConcept ?spatial. } OPTIONAL{<https://w3id.org/mica/resource/MQ1> micamodel:hasTemporalConcept ?temporal. } OPTIONAL{<https://w3id.org/mica/resource/MQ1> micamodel:hasCommodityConcept ?commodity. } OPTIONAL{<https://w3id.org/mica/resource/MQ1> micamodel:hasDataConcept ?data. } OPTIONAL{<https://w3id.org/mica/resource/MQ1> micamodel:hasValueSupplyChainConcept ?valueSupplyChain. } } group by ?question
Request variables are :
The complete query to get all the information associated to MQ1 MICAQuestion, in a human readable form, is as follows
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#> PREFIX dcterms: <http://purl.org/dc/terms/> PREFIX skos: <http://www.w3.org/2004/02/skos/core#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT DISTINCT ?question (group_concat(DISTINCT ?name; separator = ",") AS ?authors) (group_concat(DISTINCT ?relatedURILabel; separator = ",") AS ?relatedURIs) (group_concat(DISTINCT ?domainLabel; separator = ",") AS ?domains) (group_concat(DISTINCT ?methodLabel; separator = ",") AS ?methods) (group_concat(DISTINCT ?spatialLabel; separator = ",") AS ?spatials) (group_concat(DISTINCT ?temporalLabel; separator = ",") AS ?temporals) (group_concat(DISTINCT ?commodityLabel; separator = ",") AS ?commodities) (group_concat(DISTINCT ?dataLabel; separator = ",") AS ?datas) (group_concat(DISTINCT ?valueSupplyChainLabel; separator = ",") AS ?valueSupplyChains) WHERE { <https://w3id.org/mica/resource/MQ1> a micamodel:MICAQuestion; micamodel:question ?question; micamodel:hasWriter ?author. ?author foaf:givenName ?firstName; foaf:familyName ?lastName. bind(concat(?lastName," ",?firstName) as ?name) OPTIONAL{ <https://w3id.org/mica/resource/MQ1> micamodel:relatedTo ?relatedURI. OPTIONAL{?relatedURI dcterms:title ?relatedURILabel.} OPTIONAL{?relatedURI micamodel:question ?relatedURILabel.} } OPTIONAL{ <https://w3id.org/mica/resource/MQ1> micamodel:hasDomainConcept ?domain. ?domain skos:prefLabel ?domainLabel. } OPTIONAL{ <https://w3id.org/mica/resource/MQ1> micamodel:hasMethodConcept ?method. ?method skos:prefLabel ?methodLabel. } OPTIONAL{ <https://w3id.org/mica/resource/MQ1> micamodel:hasSpatialConcept ?spatial. ?spatial skos:prefLabel ?spatialLabel. } OPTIONAL{ <https://w3id.org/mica/resource/MQ1> micamodel:hasTemporalConcept ?temporal. ?temporal skos:prefLabel ?temporalLabel. } OPTIONAL{ <https://w3id.org/mica/resource/MQ1> micamodel:hasCommodityConcept ?commodity. ?commodity skos:prefLabel ?commodityLabel. } OPTIONAL{ <https://w3id.org/mica/resource/MQ1> micamodel:hasDataConcept ?data. ?data skos:prefLabel ?dataLabel. } OPTIONAL{ <https://w3id.org/mica/resource/MQ1> micamodel:hasValueSupplyChainConcept ?valueSupplyChain. ?valueSupplyChain skos:prefLabel ?valueSupplyChainLabel. } } group by ?question
Request variables are :
The following query selects all MICAQuestions by filtering with a given title text. Each metadata is represented by its label.
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#> PREFIX dcterms: <http://purl.org/dc/terms/> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX skos: <http://www.w3.org/2004/02/skos/core#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT DISTINCT ?uri ?question (group_concat(DISTINCT ?name; separator = ",") AS ?authors) (group_concat(DISTINCT ?relatedURILabel; separator = ",") AS ?relatedURIs) (group_concat(DISTINCT ?domainLabel; separator = ",") AS ?domains) (group_concat(DISTINCT ?methodLabel; separator = ",") AS ?methods) (group_concat(DISTINCT ?spatialLabel; separator = ",") AS ?spatials) (group_concat(DISTINCT ?temporalLabel; separator = ",") AS ?temporals) (group_concat(DISTINCT ?commodityLabel; separator = ",") AS ?commodities) (group_concat(DISTINCT ?dataLabel; separator = ",") AS ?datas) (group_concat(DISTINCT ?valueSupplyChainLabel; separator = ",") AS ?valueSupplyChains) WHERE { ?uri a micamodel:MICAQuestion; micamodel:question ?question; micamodel:hasWriter ?author; ?author foaf:givenName ?firstName; foaf:familyName ?lastName. bind(concat(?lastName," ",?firstName) as ?name) OPTIONAL{ ?uri micamodel:relatedTo ?relatedURI. OPTIONAL{?relatedURI dcterms:title ?relatedURILabel.} OPTIONAL{?relatedURI micamodel:question ?relatedURILabel.} } OPTIONAL{ ?uri micamodel:hasDomainConcept ?domain. ?domain skos:prefLabel ?domainLabel. } OPTIONAL{ ?uri micamodel:hasMethodConcept ?method. ?method skos:prefLabel ?methodLabel. } OPTIONAL{ ?uri micamodel:hasSpatialConcept ?spatial. ?spatial skos:prefLabel ?spatialLabel. } OPTIONAL{ ?uri micamodel:hasTemporalConcept ?temporal. ?temporal skos:prefLabel ?temporalLabel. } OPTIONAL{ ?uri micamodel:hasCommodityConcept ?commodity. ?commodity skos:prefLabel ?commodityLabel. } OPTIONAL{ ?uri micamodel:hasDataConcept ?data. ?data skos:prefLabel ?dataLabel. } OPTIONAL{ ?uri micamodel:hasValueSupplyChainConcept ?valueSupplyChain. ?valueSupplyChain skos:prefLabel ?valueSupplyChainLabel. } FILTER regex(str(?question), "", "i") } GROUP BY ?uri ?question ORDER BY ?question OFFSET 0 LIMIT 25
Request variables are :
The following query counts all MICAQuestions by filtering with a given title text.
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#> SELECT (COUNT ( DISTINCT ?uri) AS ?nbresources) WHERE { ?uri a micamodel:MICAQuestion; micamodel:question ?question. FILTER regex(str(?question), "", "i") }
Request variables are :
These queries concern resources of type micamodel:FlowSheet.
Creating a new FlowSheet whose URI is https://w3id.org/mica/resource/FS1 and with the following data:
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#> PREFIX dcterms: <http://purl.org/dc/terms/> INSERT DATA { <https://w3id.org/mica/resource/FS1> a micamodel:FlowSheet; dcterms:title "Flow Sheet #1"; micamodel:summary "Flow Sheet #1 summary"; micamodel:hasMethodConcept <https://w3id.org/mica/ontology/MicaOntology/12bebe7935734e829fa772a0c4162900>; micamodel:hasDomainConcept <https://w3id.org/mica/ontology/MicaOntology/32831dae9fc247f390f1362bee1dcd76>, <https://w3id.org/mica/ontology/MicaOntology/e2badc7277b344abb4b45d794c20a313>; micamodel:hasWriter <https://w3id.org/mica/resource/Cassard>, <https://w3id.org/mica/resource/Tertre>; micamodel:relatedTo <https://w3id.org/mica/resource/S1>, <https://w3id.org/mica/resource/S2>, <https://w3id.org/mica/resource/S3>; micamodel:hasElements ( [ micamodel:hasKnowledgeElement <https://w3id.org/mica/resource/FS2>; micamodel:role "role1"] [ micamodel:hasKnowledgeElement <https://w3id.org/mica/resource/LS1>; micamodel:role "role2"] [ micamodel:hasKnowledgeElement <https://w3id.org/mica/resource/MS1>; micamodel:role "role3"] ) . }
To update an existing flowSheet, we proceed in two steps:
For example to update FS1) FlowSheet created in the previous example by changing its summary
(replace "Flow Sheet #1 summary" by "Flow Sheet #1 new summary", adding one author (Daniel),
removing one domain concept (e2badc7277b344abb4b45d794c20a313) and adding a new KnowledgeElement (ELT4 with role "role4") at the end of the list of KnowledgeElments.
The queries will be:
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> DELETE { <https://w3id.org/mica/resource/FS1> ?p ?o. ?z rdf:first ?head ; rdf:rest ?tail . ?head micamodel:role ?role; micamodel:hasKnowledgeElement ?ke. } WHERE { <https://w3id.org/mica/resource/FS1> ?p ?o; micamodel:hasElements ?list . ?list rdf:rest* ?z . ?z rdf:first ?head ; rdf:rest ?tail . ?head micamodel:role ?role; micamodel:hasKnowledgeElement ?ke. }
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#> PREFIX dcterms: <http://purl.org/dc/terms/> INSERT DATA { <https://w3id.org/mica/resource/FS1> a micamodel:FlowSheet; dcterms:title "Flow Sheet #1"; micamodel:summary "Flow Sheet #1 new summary"; micamodel:hasMethodConcept <https://w3id.org/mica/ontology/MicaOntology/12bebe7935734e829fa772a0c4162900>; micamodel:hasDomainConcept <https://w3id.org/mica/ontology/MicaOntology/32831dae9fc247f390f1362bee1dcd76>; micamodel:hasWriter <https://w3id.org/mica/resource/Cassard>, <https://w3id.org/mica/resource/Tertre>, <https://w3id.org/mica/resource/Daniel>; micamodel:relatedTo <https://w3id.org/mica/resource/S1>, <https://w3id.org/mica/resource/S2>, <https://w3id.org/mica/resource/S3>; micamodel:hasElements ( [ micamodel:hasKnowledgeElement <https://w3id.org/mica/resource/FS2>; micamodel:role "role1"] [ micamodel:hasKnowledgeElement <https://w3id.org/mica/resource/LS1>; micamodel:role "role2"] [ micamodel:hasKnowledgeElement <https://w3id.org/mica/resource/MS1>; micamodel:role "role3"] [ micamodel:hasKnowledgeElement <https://w3id.org/mica/resource/ELT4>; micamodel:role "role4"] ) .}
The following query removes a given FlowSheet from the MICA triple store. Given the sheet URI, all the triples with this URI as subject or as object are removed.
All the triples defining the ordered list of FlowSheetElements of this FlowSheet are also removed form the triple store. If the deleted FlowSheet belongs to one or several other flowsheets:
For example to delete FS1 FlowSheet, the query is:
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> DELETE { <https://w3id.org/mica/resource/FS1> ?p ?o. ?z rdf:first ?head ; rdf:rest ?tail . ?head micamodel:role ?role; micamodel:hasKnowledgeElement ?ke. ?otherResource micamodel:relatedTo <https://w3id.org/mica/resource/FS1>. ?element micamodel:hasKnowledgeElement <https://w3id.org/mica/resource/FS1>; micamodel:role ?role1. ?node rdf:first ?element; rdf:rest ?rest. ?previousNode ?property ?node. } INSERT { ?previousNode ?property ?rest. } WHERE { <https://w3id.org/mica/resource/FS1> ?p ?o; micamodel:hasElements ?list . ?list rdf:rest* ?z . ?z rdf:first ?head ; rdf:rest ?tail . ?head micamodel:role ?role; micamodel:hasKnowledgeElement ?ke. OPTIONAL { ?otherResource micamodel:relatedTo <https://w3id.org/mica/resource/FS1>. } OPTIONAL { ?element micamodel:hasKnowledgeElement <https://w3id.org/mica/resource/FS1>; micamodel:role ?role1. ?node rdf:first ?element; rdf:rest ?rest. ?previousNode ?property ?node. } }
As for MICASheets,two options are available for retrieving queries depending on the type of information retrieved from the resources associated with the FlowSheet:
For example, the complete query to get all the information associated to FS1 FlowSheet is as follows
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#> PREFIX dcterms: <http://purl.org/dc/terms/> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> SELECT DISTINCT ?title ?summary (group_concat(DISTINCT ?sheet; separator = ",") AS ?sheets) (group_concat(DISTINCT ?author; separator = ",") AS ?authors) (group_concat(DISTINCT ?relatedURI; separator = ",") AS ?relatedURIs) (group_concat(DISTINCT ?domain; separator = ",") AS ?domains) (group_concat(DISTINCT ?method; separator = ",") AS ?methods) (group_concat(DISTINCT ?spatial; separator = ",") AS ?spatials) (group_concat(DISTINCT ?temporal; separator = ",") AS ?temporals) (group_concat(DISTINCT ?commodity; separator = ",") AS ?commodities) (group_concat(DISTINCT ?data; separator = ",") AS ?datas) (group_concat(DISTINCT ?valueSupplyChain; separator = ",") AS ?valueSupplyChains) WHERE { <https://w3id.org/mica/resource/FS1> a micamodel:FlowSheet; dcterms:title ?title; micamodel:summary ?summary; micamodel:hasWriter ?author; micamodel:hasElements/rdf:rest*/rdf:first ?element. ?element micamodel:role ?role; micamodel:hasKnowledgeElement ?micaKnowledgeElementURI. bind(concat( str(?micaKnowledgeElementURI),";",?role) as ?sheet) OPTIONAL { <https://w3id.org/mica/resource/FS1> micamodel:relatedTo ?relatedURI. } OPTIONAL { <https://w3id.org/mica/resource/FS1> micamodel:hasDomainConcept ?domain. } OPTIONAL { <https://w3id.org/mica/resource/FS1> micamodel:hasMethodConcept ?method. } OPTIONAL { <https://w3id.org/mica/resource/FS1> micamodel:hasSpatialConcept ?spatial. } OPTIONAL { <https://w3id.org/mica/resource/FS1> micamodel:hasTemporalConcept ?temporal. } OPTIONAL { <https://w3id.org/mica/resource/FS1> micamodel:hasCommodityConcept ?commodity. } OPTIONAL { <https://w3id.org/mica/resource/FS1> micamodel:hasDataConcept ?data. } OPTIONAL { <https://w3id.org/mica/resource/FS1> micamodel:hasValueSupplyChainConcept ?valueSupplyChain. } } group by ?title ?summary
Request variables are :
The complete query to get all the information associated to FS1 FlowSheet, in a human readable form, is as follows
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#> PREFIX dcterms: <http://purl.org/dc/terms/> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX skos: <http://www.w3.org/2004/02/skos/core#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT DISTINCT ?title ?summary (group_concat(DISTINCT ?sheet; separator = ",") AS ?sheets) (group_concat(DISTINCT ?name; separator = ",") AS ?authors) (group_concat(DISTINCT ?relatedURILabel; separator = ",") AS ?relatedURIs) (group_concat(DISTINCT ?domainLabel; separator = ",") AS ?domains) (group_concat(DISTINCT ?methodLabel; separator = ",") AS ?methods) (group_concat(DISTINCT ?spatialLabel; separator = ",") AS ?spatials) (group_concat(DISTINCT ?temporalLabel; separator = ",") AS ?temporals) (group_concat(DISTINCT ?commodityLabel; separator = ",") AS ?commodities) (group_concat(DISTINCT ?dataLabel; separator = ",") AS ?datas) (group_concat(DISTINCT ?valueSupplyChainLabel; separator = ",") AS ?valueSupplyChains) WHERE { <https://w3id.org/mica/resource/FS1> a micamodel:FlowSheet; dcterms:title ?title; micamodel:summary ?summary; micamodel:hasWriter ?author; micamodel:hasElements/rdf:rest*/rdf:first ?element. ?element micamodel:role ?role; micamodel:hasKnowledgeElement ?micaKnowledgeElementURI. OPTIONAL{?micaKnowledgeElementURI dcterms:title ?micaKnowledgeElementURILabel.} OPTIONAL{?micaKnowledgeElementURI micamodel:question ?micaKnowledgeElementURILabel.} bind(concat(?micaKnowledgeElementURILabel,";",?role) as ?sheet) ?author foaf:givenName ?firstName; foaf:familyName ?lastName. bind(concat(?lastName," ",?firstName) as ?name) OPTIONAL{ <https://w3id.org/mica/resource/FS1> micamodel:relatedTo ?relatedURI. OPTIONAL{?relatedURI dcterms:title ?relatedURILabel.} OPTIONAL{?relatedURI micamodel:question ?relatedURILabel.} } OPTIONAL{ <https://w3id.org/mica/resource/FS1> micamodel:hasDomainConcept ?domain. ?domain skos:prefLabel ?domainLabel. } OPTIONAL{ <https://w3id.org/mica/resource/FS1> micamodel:hasMethodConcept ?method. ?method skos:prefLabel ?methodLabel. } OPTIONAL{ <https://w3id.org/mica/resource/FS1> micamodel:hasSpatialConcept ?spatial. ?spatial skos:prefLabel ?spatialLabel. } OPTIONAL{ <https://w3id.org/mica/resource/FS1> micamodel:hasTemporalConcept ?temporal. ?temporal skos:prefLabel ?temporalLabel. } OPTIONAL{ <https://w3id.org/mica/resource/FS1> micamodel:hasCommodityConcept ?commodity. ?commodity skos:prefLabel ?commodityLabel. } OPTIONAL{ <https://w3id.org/mica/resource/FS1> micamodel:hasDataConcept ?data. ?data skos:prefLabel ?dataLabel. } OPTIONAL{ <https://w3id.org/mica/resource/FS1> micamodel:hasValueSupplyChainConcept ?valueSupplyChain. ?valueSupplyChain skos:prefLabel ?valueSupplyChainLabel. } } group by ?title ?summary
Request variables are :
The following query selects all flowSheets by filtering by a given title text. Each metadata is represented by its label.
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#> PREFIX dcterms: <http://purl.org/dc/terms/> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX skos: <http://www.w3.org/2004/02/skos/core#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT DISTINCT ?uri ?title ?summary (group_concat(DISTINCT ?sheet; separator = ",") AS ?sheets) (group_concat(DISTINCT ?name; separator = ",") AS ?authors) (group_concat(DISTINCT ?relatedURILabel; separator = ",") AS ?relatedURIs) (group_concat(DISTINCT ?domainLabel; separator = ",") AS ?domains) (group_concat(DISTINCT ?methodLabel; separator = ",") AS ?methods) (group_concat(DISTINCT ?spatialLabel; separator = ",") AS ?spatials) (group_concat(DISTINCT ?temporalLabel; separator = ",") AS ?temporals) (group_concat(DISTINCT ?commodityLabel; separator = ",") AS ?commodities) (group_concat(DISTINCT ?dataLabel; separator = ",") AS ?datas) (group_concat(DISTINCT ?valueSupplyChainLabel; separator = ",") AS ?valueSupplyChains) WHERE { ?uri a micamodel:FlowSheet; dcterms:title ?title; micamodel:summary ?summary; micamodel:hasWriter ?author; micamodel:hasElements/rdf:rest*/rdf:first ?element. ?element micamodel:role ?role; micamodel:hasKnowledgeElement ?micaKnowledgeElementURI. OPTIONAL{?micaKnowledgeElementURI dcterms:title ?micaKnowledgeElementURILabel.} OPTIONAL{?micaKnowledgeElementURI micamodel:question ?micaKnowledgeElementURILabel.} bind(concat(?micaKnowledgeElementURILabel,";",?role) as ?sheet) ?author foaf:givenName ?firstName; foaf:familyName ?lastName. bind(concat(?lastName," ",?firstName) as ?name) OPTIONAL{ ?uri micamodel:relatedTo ?relatedURI. OPTIONAL{?relatedURI dcterms:title ?relatedURILabel.} OPTIONAL{?relatedURI micamodel:question ?relatedURILabel.} } OPTIONAL{ ?uri micamodel:hasDomainConcept ?domain. ?domain skos:prefLabel ?domainLabel. } OPTIONAL{ ?uri micamodel:hasMethodConcept ?method. ?method skos:prefLabel ?methodLabel. } OPTIONAL{ ?uri micamodel:hasSpatialConcept ?spatial. ?spatial skos:prefLabel ?spatialLabel. } OPTIONAL{ ?uri micamodel:hasTemporalConcept ?temporal. ?temporal skos:prefLabel ?temporalLabel. } OPTIONAL{ ?uri micamodel:hasCommodityConcept ?commodity. ?commodity skos:prefLabel ?commodityLabel. } OPTIONAL{ ?uri micamodel:hasDataConcept ?data. ?data skos:prefLabel ?dataLabel. } OPTIONAL{ ?uri micamodel:hasValueSupplyChainConcept ?valueSupplyChain. ?valueSupplyChain skos:prefLabel ?valueSupplyChainLabel. } FILTER regex(str(?title), "", "i") } GROUP BY ?uri ?title ?summary ORDER BY ?title OFFSET 0 LIMIT 25
Request variables are :
The following query counts all FlowSheets by filtering with a given title text.
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#> PREFIX dcterms: <http://purl.org/dc/terms/> SELECT (COUNT ( DISTINCT ?uri) AS ?nbresources) WHERE { ?uri a micamodel:FlowSheet; dcterms:title ?title. FILTER regex(str(?title), "", "i") }
Request variables are :
The following query creates a relatedTo relation between two Resources:
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#> INSERT DATA { <https://w3id.org/mica/resource/FS1> micamodel:relatedTo <https://w3id.org/mica/resource/MQ1> . }
The following query removes a relatedTo relation between two MICAResources :
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#> DELETE { <https://w3id.org/mica/resource/FS1> micamodel:relatedTo <https://w3id.org/mica/resource/MQ1> . <https://w3id.org/mica/resource/MQ1> micamodel:relatedTo <https://w3id.org/mica/resource/FS1>. } WHERE { <https://w3id.org/mica/resource/FS1> micamodel:relatedTo <https://w3id.org/mica/resource/MQ1> . }
The following query get a list of relation relatedTo by filtering by a given text for label.
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#> PREFIX dcterms: <http://purl.org/dc/terms/> SELECT ?uri ?relatedURI ?uriLabel ?relatedURILabel WHERE { ?uri micamodel:relatedTo ?relatedURI. OPTIONAL{?uri dcterms:title ?uriLabel.} OPTIONAL{?uri micamodel:question ?uriLabel.} FILTER regex(str(?uriLabel), "", "i") OPTIONAL{?relatedURI dcterms:title ?relatedURILabel.} OPTIONAL{?relatedURI micamodel:question ?relatedURILabel.} } OFFSET 0 LIMIT 25
Request variables are :
The following query counts all relatedTo relation by filtering with a given text.
PREFIX micamodel: <https://w3id.org/mica/ontology/MicaModel#> PREFIX dcterms: <http://purl.org/dc/terms/> SELECT (COUNT (DISTINCT ?uri) AS ?nbRelatedTos) WHERE { ?uri micamodel:relatedTo ?relatedURI. OPTIONAL{?uri dcterms:title ?uriLabel.} OPTIONAL{?uri micamodel:question ?uriLabel.} FILTER regex(str(?uriLabel), "", "i") }
Request variables are :