sparnatural
Version:
Visual client-side SPARQL query builder and knowledge graph exploration tool
403 lines (359 loc) • 18.8 kB
text/turtle
schema: <http://schema.org/> .
adms: <http://www.w3.org/ns/adms#> .
owl: <http://www.w3.org/2002/07/owl#> .
org: <http://www.w3.org/ns/org#> .
xls2rdf: <https://xls2rdf.sparna.fr/vocabulary#> .
this: <https://data.mydomain.com/ontologies/sparnatural-config/> .
xsd: <http://www.w3.org/2001/XMLSchema#> .
skosthes: <http://purl.org/iso25964/skos-thes#> .
rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
odb: <http://example.com/ontology/odb#> .
core: <http://data.sparna.fr/ontologies/sparnatural-config-core#> .
qb: <http://purl.org/linked-data/cube#> .
datasources: <http://data.sparna.fr/ontologies/sparnatural-config-datasources#> .
dct: <http://purl.org/dc/terms/> .
doap: <http://usefulinc.com/ns/doap#> .
sh: <http://www.w3.org/ns/shacl#> .
rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
dcat: <http://www.w3.org/ns/dcat#> .
euvoc: <http://publications.europa.eu/ontology/euvoc#> .
prov: <http://www.w3.org/ns/prov#> .
foaf: <http://xmlns.com/foaf/0.1/> .
dc: <http://purl.org/dc/elements/1.1/> .
skos: <http://www.w3.org/2004/02/skos/core#> .
skosxl: <http://www.w3.org/2008/05/skos-xl#> .
<https://data.mydomain.com/ontologies/sparnatural-config> a owl:Ontology;
owl:imports <http://data.sparna.fr/ontologies/sparnatural-config-core>, <http://data.sparna.fr/ontologies/sparnatural-config-datasources> .
odb:Manufacturer a owl:Class;
rdfs:subClassOf core:SparnaturalClass;
rdfs:label "Manufacturer", "Constructeur";
core:faIcon "fa-solid fa-industry";
core:tooltip "A car manufacturer is a company whose main activity is the design, construction and marketing of cars.",
"Un constructeur automobile est une entreprise qui a pour activité principale la conception, la construction et la commercialisation de voitures.";
core:order "2"^^xsd:integer;
core:defaultLabelProperty odb:name .
odb:Vehicle a owl:Class;
rdfs:subClassOf core:SparnaturalClass;
rdfs:label "Vehicle", "Véhicule";
core:faIcon "fa-solid fa-car";
core:tooltip "A vehicle is a car model for a specific brand.", "Un véhicule est un modèle de voiture pour une marque spécifique.";
core:order "1"^^xsd:integer;
core:defaultLabelProperty odb:VIN .
odb:Diagnostic a owl:Class;
rdfs:subClassOf core:SparnaturalClass;
rdfs:label "Diagnosis", "Diagnostic";
core:faIcon "fa-solid fa-stethoscope";
core:tooltip "A diagnosis identifies a possible problem on your vehicle. You can request a diagnosis when you suspect a breakdown or malfunction. Using an auto diagnosis kit, the mechanic identifies the problem with your vehicle.",
"Un diagnostic permet d'identifier un éventuel problème sur votre véhicule. Vous pouvez demander un diagnostic quand vous suspectez une panne ou un dysfonctionnement. À l'aide d'une valise de diagnostic auto, le mécanicien identifie le problème subi par votre véhicule.";
core:order "3"^^xsd:integer .
odb:Error a owl:Class;
rdfs:subClassOf core:SparnaturalClass;
rdfs:label "Error", "Erreur";
core:faIcon "fa-solid fa-circle-exclamation";
core:tooltip "An error is an element that comes up during a diagnosis, which indicates that the vehicle on which the analysis was carried out is encountering a problem.",
"Une erreur est un élément qui remonte lors d'un diagnostic, qui indique que le véhicule sur lequel on a fait l'analyse rencontre un problème.";
core:order "4"^^xsd:integer .
odb:ErrorCode a owl:Class;
rdfs:subClassOf core:SparnaturalClass;
rdfs:label "Error code", "Code d'erreur";
core:faIcon "fa-solid fa-ticket";
core:tooltip "An error code is a set of numbers following a letter corresponding to a problem detected on your vehicle. The letter gives an indication of the family of the defect.",
"Un code erreur, est un ensemble de chiffres suivant une lettre correspondant à un problème détecté sur votre véhicule. La lettre donne une indication sur la famille du défaut.";
core:order "5"^^xsd:integer .
odb:Symptom a owl:Class;
rdfs:subClassOf core:SparnaturalClass;
rdfs:label "Symptom", "Symptôme";
core:faIcon "fa-solid fa-magnifying-glass";
core:tooltip "A symptom is a phenomenon, perceptible or observable character linked to a state, a problem that it allows to detect, of which it is the sign.",
"Un symptôme est un Phénomène, caractère perceptible ou observable lié à un état, un problème qu'il permet de déceler, dont il est le signe.";
core:order "7"^^xsd:integer;
core:defaultLabelProperty this:symptomLabel .
odb:Component a owl:Class;
rdfs:subClassOf core:SparnaturalClass;
rdfs:label "Component", "Composant";
core:faIcon "fa-solid fa-gear";
core:tooltip "A class representing a component of a vehicle.", "Une classe représentant un composant d'un véhicule.";
core:order "6"^^xsd:integer;
core:defaultLabelProperty this:componentLabel .
this:Attribute a owl:Class;
rdfs:subClassOf rdfs:Literal;
rdfs:label "Attribute", "Attribut (littéral)";
core:faIcon "fa-solid fa-pen-to-square";
core:tooltip "A class to display literal values (as example : text, boolean, date, etc.)",
"Une classe pour afficher les valeurs littérales." .
odb:name a owl:ObjectProperty;
rdfs:label "has name", "nom";
rdfs:subPropertyOf core:NonSelectableProperty;
core:tooltip "Specifies the name of the manufacturer.", "Spécifie le nom du constructeur.";
rdfs:domain odb:Manufacturer;
rdfs:range this:Attribute .
odb:VIN a owl:ObjectProperty;
rdfs:label "has VIN", "a pour VIN";
rdfs:subPropertyOf core:AutocompleteProperty;
core:tooltip "Specifies the Vehicle Identification Number (VIN) of the vehicle.",
"Spécifie le numéro d'identification du véhicule (VIN).";
rdfs:domain odb:Vehicle;
rdfs:range this:Attribute .
odb:hasManufacturer a owl:ObjectProperty;
rdfs:label "has manufacturer", "a pour constructeur";
rdfs:subPropertyOf core:ListProperty;
core:tooltip "Specifies the manufacturer of the vehicle.", "Spécifie le constructeur d'un véhicule.";
rdfs:domain odb:Vehicle;
rdfs:range odb:Manufacturer;
datasources:datasource this:list_odbname_alpha;
core:enableNegation "true"^^xsd:boolean .
this:hasDiagnosis a owl:ObjectProperty;
rdfs:label "has diagnosis", "a pour diagnostic";
rdfs:subPropertyOf core:NonSelectableProperty;
core:tooltip "The property is the inverse of odb:analysedVehicle.", "Propriété inverse de odb:analysedVehicle.";
rdfs:domain odb:Vehicle;
rdfs:range odb:Diagnostic;
core:sparqlString "^<http://example.com/ontology/odb#analysedVehicle>";
core:enableNegation "true"^^xsd:boolean .
odb:diagnosticDate a owl:ObjectProperty;
rdfs:label "has diagnosis date", "date du diagnostic";
rdfs:subPropertyOf core:TimeProperty-Date;
core:tooltip "Defines the date on which the diagnosis occurs.", "Définit la date à laquelle le diagnostic a eu lieu.";
rdfs:domain odb:Diagnostic;
rdfs:range this:Attribute;
core:enableNegation "true"^^xsd:boolean .
odb:analysedVehicle a owl:ObjectProperty;
rdfs:label "analysed vehicle", "véhicule analysé";
rdfs:subPropertyOf core:AutocompleteProperty;
core:tooltip "Specifies that the vehicle has been analyzed, to identify a potential problem.",
"Spécifie que le véhicule a été analysé, pour identifier un potentiel problème.";
rdfs:domain odb:Diagnostic;
rdfs:range odb:Vehicle;
datasources:datasource this:search_VIN_strstarts .
odb:hasResults a owl:ObjectProperty;
rdfs:label "has results", "a pour résultat";
rdfs:subPropertyOf core:NonSelectableProperty;
core:tooltip "Specifies the results, from the analysis.", "Spécifie les résultats issus de l'analyse.";
rdfs:domain odb:Diagnostic;
rdfs:range odb:Error .
odb:diagnosticPlace a owl:ObjectProperty;
rdfs:label "has diagnosis place", "lieu du diagnostic";
rdfs:subPropertyOf core:MapProperty;
core:tooltip "Defines the place where the diagnosis occurs.", "Définit le lieu où le diagnostic a été effectué.";
rdfs:domain odb:Diagnostic;
rdfs:range this:Attribute .
this:returnsCode a owl:ObjectProperty;
rdfs:label "returns code", "renvoie le code";
rdfs:subPropertyOf core:ListProperty;
core:tooltip "The property is a shortcut between Diagnosis and Error Code.", "Cette propriété est un raccourci entre Diagnostic et Code d'erreur.";
rdfs:domain odb:Diagnostic;
rdfs:range odb:ErrorCode;
core:sparqlString "<http://example.com/ontology/odb#hasResults>/<http://example.com/ontology/odb#hasErrorCode>" .
odb:alreadyRaised a owl:ObjectProperty;
rdfs:label "already raised", "déjà signalée";
rdfs:subPropertyOf core:BooleanProperty;
core:tooltip "Attribute indicating whether an error has already been detected previously.",
"Attribut permettant de savoir si une erreur a déjà été relevée précédemment.";
rdfs:domain odb:Error;
rdfs:range this:Attribute;
core:enableOptional "true"^^xsd:boolean;
core:enableNegation "true"^^xsd:boolean .
odb:hasErrorCode a owl:ObjectProperty;
rdfs:label "has error code", "a pour code d'erreur";
rdfs:subPropertyOf core:ListProperty;
core:tooltip "Specifies the error code relating to an error reported during a diagnostic.",
"Spécifie le code erreur relatif à une erreur remontée lors d'un diagnostic.";
rdfs:domain odb:Error;
rdfs:range odb:ErrorCode;
core:enableNegation "true"^^xsd:boolean .
odb:hasSymptom a owl:ObjectProperty;
rdfs:label "has symptom", "a pour symptôme";
rdfs:subPropertyOf core:ListProperty;
core:tooltip "Specifies the symptoms associated with an error code.", "Spécifie le symptôme associé à un code erreur.";
rdfs:domain odb:ErrorCode;
rdfs:range odb:Symptom;
datasources:datasource datasources:list_rdfslabel_alpha;
core:enableNegation "true"^^xsd:boolean .
this:hasComponentList a owl:ObjectProperty;
rdfs:label "has component (list)", "concerne le composant (liste)";
rdfs:subPropertyOf core:ListProperty;
core:tooltip "Specifies the components impacted by an error code.", "Spécifie le composant impacté par un code erreur.";
rdfs:domain odb:ErrorCode;
rdfs:range odb:Component;
datasources:datasource this:list_componentCode_alpha;
core:sparqlString "<http://example.com/ontology/odb#hasComponent>";
core:enableNegation "true"^^xsd:boolean .
this:hasComponentTree a owl:ObjectProperty;
rdfs:label "has component (tree)", "concerne le composant (arbre)";
rdfs:subPropertyOf core:TreeProperty;
core:tooltip "Specifies the components impacted by an error code.", "Spécifie le composant impacté par un code erreur.";
rdfs:domain odb:ErrorCode;
rdfs:range odb:Component;
core:sparqlString "<http://example.com/ontology/odb#hasComponent>";
core:enableNegation "true"^^xsd:boolean;
datasources:treeRootsDatasource this:tree_root_Component;
datasources:treeChildrenDatasource this:tree_children_Component .
this:symptomLabel a owl:ObjectProperty;
rdfs:label "label", "a pour libellé";
rdfs:subPropertyOf core:SearchProperty;
core:tooltip "Specifies the name of the object.", "Spécifie le nom du Sympôme";
rdfs:domain odb:Symptom;
rdfs:range this:Attribute;
core:sparqlString "<http://www.w3.org/2000/01/rdf-schema#label>" .
odb:componentCode a owl:ObjectProperty;
rdfs:label "has component code", "a pour code composant";
rdfs:subPropertyOf core:SearchProperty;
core:tooltip "Specifies the unique code of the component.", "Spécifie le code unique relatif à un composant.";
rdfs:domain odb:Component;
rdfs:range this:Attribute .
this:componentLabel a owl:ObjectProperty;
rdfs:label "label", "a pour libellé";
rdfs:subPropertyOf core:SearchProperty;
core:tooltip "Specifies the name of the object.", "Spécifie le nom du Composant";
rdfs:domain odb:Component;
rdfs:range this:Attribute;
core:sparqlString "<http://www.w3.org/2000/01/rdf-schema#label>";
core:isMultilingual "true"^^xsd:boolean .
this:labelOrCode a owl:ObjectProperty;
rdfs:label "label or code", "a pour libellé ou code";
rdfs:subPropertyOf core:SearchProperty;
core:tooltip "Allows to get a label or a code.", "Permet de rechercher un libellé ou un code.";
rdfs:domain odb:Component;
rdfs:range this:Attribute;
core:sparqlString "<http://example.com/ontology/odb#componentCode>|<http://www.w3.org/2000/01/rdf-schema#label>" .
this:list_myname_count a datasources:SparqlDatasource;
datasources:queryTemplate datasources:query_list_label_count;
datasources:labelProperty "<http://example.com/ontology/myname>" .
this:list_skosprefLabel_alpha_with_count_langfr a datasources:SparqlDatasource;
datasources:queryTemplate this:query_list_label_alpha_with_count_langfr;
datasources:labelProperty skos:prefLabel .
this:list_odbname_alpha a datasources:SparqlDatasource;
datasources:queryTemplate datasources:query_list_label_alpha;
datasources:labelProperty odb:name .
this:search_VIN_strstarts a datasources:SparqlDatasource;
datasources:queryTemplate datasources:query_search_label_strstarts;
datasources:labelProperty odb:VIN .
this:list_componentCode_alpha a datasources:SparqlDatasource;
datasources:queryString """PREFIX odb: <http://example.com/ontology/odb#>
SELECT DISTINCT ?uri ?label
WHERE {
?domain $type $domain .
?domain $property ?uri .
# Note how the range criteria is not used in this query
FILTER(isIRI(?uri))
?uri rdfs:label ?libelleComposant .
FILTER(lang(?libelleComposant) = \"\" || lang(?libelleComposant) = $lang)
?uri odb:componentCode ?codeComposant .
# Concat component code + component label
BIND(CONCAT(STR(?codeComposant),\" - \",STR(?libelleComposant)) AS ?label)
}
ORDER BY UCASE(?label)
LIMIT 500""" .
this:tree_root_Component a datasources:SparqlDatasource;
datasources:queryString """PREFIX odb: <http://example.com/ontology/odb#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#label>
SELECT ?uri ?label ?hasChildren (COUNT(?x) AS ?count) WHERE {
?uri a odb:Component .
# Keep only roots, that do not have any parent
FILTER NOT EXISTS {
?uri odb:parentComponent ?parent .
}
?uri rdfs:label ?libelleComposant .
FILTER(lang(?libelleComposant) = \"\" || lang(?libelleComposant) = $lang)
?uri odb:componentCode ?codeComposant .
# Concat component code + component label
BIND(CONCAT(STR(?codeComposant),\" - \",STR(?libelleComposant)) AS ?label)
OPTIONAL { ?uri ^odb:parentComponent ?children }
BIND(IF(bound(?children),true,false) AS ?hasChildren)
OPTIONAL {
?x a $domain .
?x $property ?uri .
}
}
GROUP BY ?uri ?label ?hasChildren
ORDER BY ?label""" .
this:tree_children_Component a datasources:SparqlDatasource;
datasources:queryString """PREFIX odb: <http://example.com/ontology/odb#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#label>
SELECT DISTINCT ?uri ?label ?hasChildren (COUNT(?x) AS ?count) WHERE {
$node ^odb:parentComponent ?uri .
?uri rdfs:label ?libelleComposant .
FILTER(lang(?libelleComposant) = \"\" || lang(?libelleComposant) = $lang)
?uri odb:componentCode ?codeComposant .
# Concat component code + component label
BIND(CONCAT(STR(?codeComposant),\" - \",STR(?libelleComposant)) AS ?label)
OPTIONAL { ?uri ^odb:parentComponent ?children }
BIND(IF(bound(?children),true,false) AS ?hasChildren)
OPTIONAL {
?x a $domain .
?x $property ?uri .
}
}
GROUP BY ?uri ?label ?hasChildren
ORDER BY ?label""" .
this:query_list_label_alpha_with_count_langfr a datasources:SPARQLQuery;
datasources:queryString """SELECT DISTINCT ?uri ?count (CONCAT(STR(?theLabel), ' (', STR(?count), ')') AS ?label)
WHERE {
{
SELECT DISTINCT ?uri (COUNT(?domain) AS ?count)
WHERE {
?domain a $domain .
?domain $property ?uri .
FILTER(isIRI(?uri))
# Note how the range criteria is not used in this query
}
GROUP BY ?uri
}
OPTIONAL { ?uri $labelPath ?theLabelLang . FILTER(lang(?theLabelLang) = $lang) }
OPTIONAL { ?uri $labelPath ?theLabelNone . FILTER(lang(?theLabelNone) = \"\") }
OPTIONAL { ?uri $labelPath ?theLabelFr . FILTER(lang(?theLabelFr) = \"fr\") }
BIND(COALESCE(?theLabelLang, ?theLabelNone, ?theLabelFr, STR(?uri)) AS ?theLabel)
}
ORDER BY UCASE(?label)
LIMIT 500""";
rdfs:comment "A query that will list entries alphabetically with number of occurrences in parenthesis by fetching first in the user language but will default to French" .
this:query_list_label_count_langfr a datasources:SPARQLQuery;
datasources:queryString """SELECT ?uri ?count (CONCAT(STR(?theLabel), ' (', STR(?count), ')') AS ?label)
WHERE {
{
SELECT DISTINCT ?uri (COUNT(?domain) AS ?count)
WHERE {
?domain a $domain .
?domain $property ?uri .
FILTER(isIRI(?uri))
# Note how the range criteria is not used in this query
}
GROUP BY ?uri
}
OPTIONAL { ?uri $labelPath ?theLabelLang . FILTER(lang(?theLabelLang) = $lang) }
OPTIONAL { ?uri $labelPath ?theLabelNone . FILTER(lang(?theLabelNone) = \"\") }
OPTIONAL { ?uri $labelPath ?theLabelFr . FILTER(lang(?theLabelFr) = \"fr\") }
BIND(COALESCE(?theLabelLang, ?theLabelNone, ?theLabelFr) AS ?theLabel)
}
ORDER BY DESC(?count) UCASE(?label)
LIMIT 500""";
rdfs:comment "A query that will list entries by descending number of occurrences by fetching first in the user langauge but will default to French" .
this:query_list_label_alpha_langfr a datasources:SPARQLQuery;
datasources:queryString """SELECT DISTINCT ?uri ?label
WHERE {
?domain a $domain .
?domain $property ?uri .
# Note how the range criteria is not used in this query
FILTER(isIRI(?uri))
OPTIONAL { ?uri $labelPath ?theLabelLang . FILTER(lang(?theLabelLang) = $lang) }
OPTIONAL { ?uri $labelPath ?theLabelNone . FILTER(lang(?theLabelNone) = \"\") }
OPTIONAL { ?uri $labelPath ?theLabelFr . FILTER(lang(?theLabelFr) = \"fr\") }
BIND(COALESCE(?theLabelLang, ?theLabelNone, ?theLabelFr) AS ?label)
}
ORDER BY UCASE(?label)
LIMIT 500""";
rdfs:comment "A query that will list entries alphabetically by fetching first in the user language but will default to French" .
this:query_search_label_contains_langfr a datasources:SPARQLQuery;
datasources:queryString """SELECT DISTINCT ?uri ?label
WHERE {
?domain a $domain .
?domain $property ?uri .
?uri a $range .
?uri $labelPath ?label .
FILTER(isIRI(?uri))
FILTER(CONTAINS(LCASE(STR(?label)), LCASE(\"$key\")))
FILTER(lang(?label) = '' || lang(?label) = \"fr\")
}
ORDER BY UCASE(?label)
LIMIT 50""";
rdfs:comment "A query that will search in labels using contains function, first in the user language but will default to French." .