Skip to content
Snippets Groups Projects
Commit 857ee84c authored by David Rouquet's avatar David Rouquet
Browse files

init

parent bd4f3f30
Branches
No related tags found
No related merge requests found
A serialisation of the Universal Networking Language (UNL) using RDF triples.
# baseURI: https://unl.tetras-libre.fr/rdf/rdf-unl-example-owl-extraction
# imports: https://unl.tetras-libre.fr/rdf/shacl-rules
# prefix: rdf-unl-example-owl-extraction
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdf-unl-example-owl-extraction: <https://unl.tetras-libre.fr/rdf/rdf-unl-example-owl-extraction#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix shacl-rules: <https://unl.tetras-libre.fr/rdf/shacl-rules#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<https://unl.tetras-libre.fr/rdf/example#be_in_a_state(aoj--thing,icl--be,obj--state)>
rdf:type owl:DatatypeProperty ;
rdfs:domain <https://unl.tetras-libre.fr/rdf/example#channel(icl--radiowave)> ;
rdfs:range <https://unl.tetras-libre.fr/rdf/example#state(icl--attribute)> ;
.
<https://unl.tetras-libre.fr/rdf/example#channel(icl--radiowave)>
rdf:type owl:Class ;
.
<https://unl.tetras-libre.fr/rdf/example#channel(icl--radiowave)__00000014>
rdf:type <https://unl.tetras-libre.fr/rdf/example#channel(icl--radiowave)> ;
<https://unl.tetras-libre.fr/rdf/example#be_in_a_state(aoj--thing,icl--be,obj--state)> "broadcast(icl>message)" ;
.
<https://unl.tetras-libre.fr/rdf/example#state(icl--attribute)>
rdf:type rdfs:Datatype ;
owl:cardinality 2 ;
owl:equivalentClass [
rdf:type rdfs:Datatype ;
owl:oneOf (
"listening(icl>sensing)"
"traffic(icl>communication)"
) ;
] ;
owl:equivalentClass [
rdf:type rdfs:Datatype ;
owl:oneOf (
"listening(icl>sensing)"
"traffic(icl>communication)"
) ;
] ;
.
<https://unl.tetras-libre.fr/rdf/rdf-unl-example-owl-extraction>
rdf:type owl:Ontology ;
owl:imports <https://unl.tetras-libre.fr/rdf/shacl-rules> ;
owl:versionInfo "Created with TopBraid Composer" ;
.
This diff is collapsed.
This diff is collapsed.
# baseURI: https://unl.tetras-libre.fr/rdf/shacl-rules
# imports: http://datashapes.org/dash
# imports: https://unl.tetras-libre.fr/rdf/example
# imports: https://unl.tetras-libre.fr/rdf/schema
# prefix: shacl-rules
@prefix : <https://unl.tetras-libre.fr/rdf/shacl-rules#> .
@prefix dash: <http://datashapes.org/dash#> .
@prefix example: <https://unl.tetras-libre.fr/rdf/example#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix shacl-rules: <https://unl.tetras-libre.fr/rdf/shacl-rules#> .
@prefix unl: <https://unl.tetras-libre.fr/rdf/schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<http://www.w3.org/1999/02/22-rdf-syntax-ns>
rdf:type owl:Ontology ;
sh:declare shacl-rules:PrefixDeclaration_rdf ;
.
<http://www.w3.org/2000/01/rdf-schema>
rdf:type owl:Ontology ;
sh:declare shacl-rules:PrefixDeclaration_rdfs ;
.
<http://www.w3.org/2001/XMLSchema>
rdf:type owl:Ontology ;
sh:declare shacl-rules:PrefixDeclaration_xsd ;
.
<http://www.w3.org/2002/07/owl>
sh:declare shacl-rules:PrefixDeclaration_owl ;
.
<https://unl.tetras-libre.fr/rdf/schema>
sh:declare shacl-rules:PrefixDeclaration_unl ;
.
unl:UW_Occurrence
rdf:type sh:NodeShape ;
sh:rule shacl-rules:icl--be-aoj-obj-mod_to_owl-instanciatedDatatypeProperty ;
sh:rule shacl-rules:icl--be_to_owl-DatatypeProperty ;
.
unl:cnt
rdf:type sh:NodeShape ;
sh:rule shacl-rules:unl-cnt-1and_to_owl-oneof ;
sh:rule shacl-rules:unl-cnt-2and_to_owl-oneof ;
sh:rule shacl-rules:unl-cnt-3and_to_owl-oneof ;
sh:rule shacl-rules:unl-cnt-4and_to_owl-oneof ;
.
unl:qua
rdf:type sh:NodeShape ;
sh:rule shacl-rules:unl-qua_to_owl-cardinality ;
.
<https://unl.tetras-libre.fr/rdf/shacl-rules>
rdf:type owl:Ontology ;
owl:imports <http://datashapes.org/dash> ;
owl:imports <https://unl.tetras-libre.fr/rdf/example> ;
owl:imports <https://unl.tetras-libre.fr/rdf/schema> ;
owl:versionInfo "Created with TopBraid Composer" ;
.
shacl-rules:PrefixDeclaration_owl
rdf:type sh:PrefixDeclaration ;
sh:namespace "http://www.w3.org/2002/07/owl#"^^xsd:anyURI ;
sh:prefix "owl" ;
.
shacl-rules:PrefixDeclaration_rdf
rdf:type sh:PrefixDeclaration ;
sh:namespace "http://www.w3.org/1999/02/22-rdf-syntax-ns#"^^xsd:anyURI ;
sh:prefix "rdf" ;
.
shacl-rules:PrefixDeclaration_rdfs
rdf:type sh:PrefixDeclaration ;
sh:namespace "http://www.w3.org/2000/01/rdf-schema#"^^xsd:anyURI ;
sh:prefix "rdfs" ;
.
shacl-rules:PrefixDeclaration_unl
rdf:type sh:PrefixDeclaration ;
sh:namespace "https://unl.tetras-libre.fr/rdf/schema#"^^xsd:anyURI ;
sh:prefix "unl" ;
.
shacl-rules:PrefixDeclaration_xsd
rdf:type sh:PrefixDeclaration ;
sh:namespace "http://www.w3.org/2001/XMLSchema#"^^xsd:anyURI ;
sh:prefix "xsd" ;
.
shacl-rules:icl--be-aoj-obj-mod_to_owl-instanciatedDatatypeProperty
rdf:type sh:SPARQLRule ;
sh:construct """CONSTRUCT {
?aoj a ?aojLex ;
?lex ?modLabel
}
WHERE {
?this rdfs:label ?label .
FILTER regex(str(?label),\"icl>be\")
?this unl:aoj ?aoj ;
unl:obj ?obj ;
unl:is_occurrence_of ?lex .
?aoj unl:has_unl_attribute \"@indef\"^^unl:att ; unl:is_occurrence_of ?aojLex .
?obj unl:mod ?mod ; rdfs:label ?objLabel .
FILTER regex(?objLabel,\"icl>attribute\")
?mod rdfs:label ?modLabel .
} """ ;
sh:prefixes <http://www.w3.org/2000/01/rdf-schema> ;
sh:prefixes <https://unl.tetras-libre.fr/rdf/schema> ;
.
shacl-rules:icl--be_to_owl-DatatypeProperty
rdf:type sh:SPARQLRule ;
sh:construct """CONSTRUCT {
?lex a owl:DatatypeProperty ;
rdfs:domain ?slex ;
rdfs:range ?tlex .
?slex a owl:Class .
?tlex a rdfs:Datatype .
}
WHERE {
?this unl:is_occurrence_of ?lex .
?lex rdfs:label ?label .
FILTER regex(str(?label),\"icl>be\")
?this unl:aoj ?s .
?this unl:obj ?t .
?s unl:is_occurrence_of ?slex .
?t unl:is_occurrence_of ?tlex .
?tlex rdfs:label ?tlabel .
FILTER regex(str(?tlabel),\"icl>attribute\")
} """ ;
sh:prefixes <http://www.w3.org/2000/01/rdf-schema> ;
sh:prefixes <http://www.w3.org/2002/07/owl> ;
sh:prefixes <https://unl.tetras-libre.fr/rdf/schema> ;
.
shacl-rules:unl-cnt-1and_to_owl-oneof
rdf:type sh:SPARQLRule ;
sh:construct """CONSTRUCT {
?lex owl:equivalentClass [
rdf:type rdfs:Datatype ;
owl:oneOf (?l1 ?l2)
]
}
WHERE {
?this a unl:cnt ;
unl:has_source ?s ;
unl:has_target ?t1 .
?s unl:is_occurrence_of ?lex .
?lex rdfs:label ?label .
FILTER regex(?label,\"icl>attribute\")
?and1 a unl:and ;
unl:has_source ?t1 ;
unl:has_target ?t2 .
?t1 rdfs:label ?l1 .
?t2 rdfs:label ?l2 .
} """ ;
sh:order "-1"^^xsd:decimal ;
sh:prefixes <http://www.w3.org/1999/02/22-rdf-syntax-ns> ;
sh:prefixes <http://www.w3.org/2000/01/rdf-schema> ;
sh:prefixes <http://www.w3.org/2002/07/owl> ;
sh:prefixes <https://unl.tetras-libre.fr/rdf/schema> ;
.
shacl-rules:unl-cnt-2and_to_owl-oneof
rdf:type sh:SPARQLRule ;
sh:construct """CONSTRUCT {
?lex owl:equivalentClass [
rdf:type rdfs:Datatype ;
owl:oneOf (?l1 ?l2 ?l3)
]
}
WHERE {
?this a unl:cnt ;
unl:has_source ?s ;
unl:has_target ?t1 .
?s unl:is_occurrence_of ?lex .
?lex rdfs:label ?label .
FILTER regex(?label,\"icl>attribute\")
?and1 a unl:and ;
unl:has_source ?t1 ;
unl:has_target ?t2 .
?and2 a unl:and ;
unl:has_source ?t2 ;
unl:has_target ?t3 .
?t1 rdfs:label ?l1 .
?t2 rdfs:label ?l2 .
?t3 rdfs:label ?l3 .
} """ ;
sh:order "-2"^^xsd:decimal ;
sh:prefixes <http://www.w3.org/1999/02/22-rdf-syntax-ns> ;
sh:prefixes <http://www.w3.org/2000/01/rdf-schema> ;
sh:prefixes <http://www.w3.org/2002/07/owl> ;
sh:prefixes <https://unl.tetras-libre.fr/rdf/schema> ;
.
shacl-rules:unl-cnt-3and_to_owl-oneof
rdf:type sh:SPARQLRule ;
sh:construct """CONSTRUCT {
?lex owl:equivalentClass [
rdf:type rdfs:Datatype ;
owl:oneOf (?l1 ?l2 ?l3 ?l4)
]
}
WHERE {
?this a unl:cnt ;
unl:has_source ?s ;
unl:has_target ?t1 .
?s unl:is_occurrence_of ?lex .
?lex rdfs:label ?label .
FILTER regex(?label,\"icl>attribute\")
?and1 a unl:and ;
unl:has_source ?t1 ;
unl:has_target ?t2 .
?and2 a unl:and ;
unl:has_source ?t2 ;
unl:has_target ?t3 .
?and3 a unl:and ;
unl:has_source ?t3 ;
unl:has_target ?t4 .
?t1 rdfs:label ?l1 .
?t2 rdfs:label ?l2 .
?t3 rdfs:label ?l3 .
?t4 rdfs:label ?l4 .
} """ ;
sh:order "-3"^^xsd:decimal ;
sh:prefixes <http://www.w3.org/1999/02/22-rdf-syntax-ns> ;
sh:prefixes <http://www.w3.org/2000/01/rdf-schema> ;
sh:prefixes <http://www.w3.org/2002/07/owl> ;
sh:prefixes <https://unl.tetras-libre.fr/rdf/schema> ;
.
shacl-rules:unl-cnt-4and_to_owl-oneof
rdf:type sh:SPARQLRule ;
sh:construct """CONSTRUCT {
?lex owl:equivalentClass [
rdf:type rdfs:Datatype ;
owl:oneOf (?l1 ?l2 ?l3 ?l4 ?l5)
]
}
WHERE {
?this a unl:cnt ;
unl:has_source ?s ;
unl:has_target ?t1 .
?s unl:is_occurrence_of ?lex .
?lex rdfs:label ?label .
FILTER regex(?label,\"icl>attribute\")
?and1 a unl:and ;
unl:has_source ?t1 ;
unl:has_target ?t2 .
?and2 a unl:and ;
unl:has_source ?t2 ;
unl:has_target ?t3 .
?and3 a unl:and ;
unl:has_source ?t3 ;
unl:has_target ?t4 .
?and4 a unl:and ;
unl:has_source ?t4 ;
unl:has_target ?t5 .
?t1 rdfs:label ?l1 .
?t2 rdfs:label ?l2 .
?t3 rdfs:label ?l3 .
?t4 rdfs:label ?l4 .
?t5 rdfs:label ?l5 .
} """ ;
sh:order "-4"^^xsd:decimal ;
sh:prefixes <http://www.w3.org/1999/02/22-rdf-syntax-ns> ;
sh:prefixes <http://www.w3.org/2000/01/rdf-schema> ;
sh:prefixes <http://www.w3.org/2002/07/owl> ;
sh:prefixes <https://unl.tetras-libre.fr/rdf/schema> ;
.
shacl-rules:unl-qua_to_owl-cardinality
rdf:type sh:SPARQLRule ;
sh:construct """CONSTRUCT {?lex owl:cardinality ?tInt }
WHERE {
?this a unl:qua ;
unl:has_source ?s ;
unl:has_target ?t .
?t rdfs:label ?tLabel .
?s unl:is_occurrence_of ?lex
BIND(xsd:integer(?tLabel) AS ?tInt)
}""" ;
sh:prefixes <http://www.w3.org/2000/01/rdf-schema> ;
sh:prefixes <http://www.w3.org/2001/XMLSchema> ;
sh:prefixes <http://www.w3.org/2002/07/owl> ;
sh:prefixes <https://unl.tetras-libre.fr/rdf/schema> ;
.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment