From ba6acb34b5798b45e510f787887cbf818d969e73 Mon Sep 17 00:00:00 2001 From: eliott <eliott.sammier@tetras-libre.fr> Date: Tue, 25 Jun 2024 16:38:27 +0200 Subject: [PATCH] Update metadata for full ontology --- tetras_extraction/macao_12/result/macao_full.ttl | 9 ++------- tetras_extraction/macao_12/script/src/transform.py | 11 +++++++++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/tetras_extraction/macao_12/result/macao_full.ttl b/tetras_extraction/macao_12/result/macao_full.ttl index 547d75f0..6cd9b157 100644 --- a/tetras_extraction/macao_12/result/macao_full.ttl +++ b/tetras_extraction/macao_12/result/macao_full.ttl @@ -4,9 +4,8 @@ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . -<http://www.semanticweb.org/eliott/ontologies/2024/4/macao-content> a owl:Ontology ; - rdfs:label "macao-content" ; - owl:imports <http://www.semanticweb.org/eliott/ontologies/2024/4/macao> . +<http://www.semanticweb.org/eliott/ontologies/2024/4/macao-full> a owl:Ontology ; + rdfs:label "macao-full" . :Image a owl:Class ; rdfs:subClassOf :MacaoObject, @@ -84,10 +83,6 @@ rdfs:domain :MacaoContenu ; rdfs:range rdf:PlainLiteral . -<http://www.semanticweb.org/eliott/ontologies/2024/4/macao> a owl:Ontology ; - rdfs:label "macao-schema"@fr ; - owl:versionInfo 1.1 . - :FlashObject a owl:Class ; rdfs:subClassOf :MacaoObject, :MacaoRessource . diff --git a/tetras_extraction/macao_12/script/src/transform.py b/tetras_extraction/macao_12/script/src/transform.py index 9bfc7790..a0c38908 100644 --- a/tetras_extraction/macao_12/script/src/transform.py +++ b/tetras_extraction/macao_12/script/src/transform.py @@ -1,4 +1,4 @@ -from rdflib import Graph +from rdflib import OWL, RDF, Graph from common import * @@ -72,5 +72,12 @@ def main(): # """, # ) - # Save the full graph + # ==> Save + # Remove dependency on previous ontologies + for ontology in graph.subjects(RDF.type, OWL.Ontology): + graph.remove((ontology, None, None)) + # Declare new ontology + onto_uri = URIRef("http://www.semanticweb.org/eliott/ontologies/2024/4/macao-full") + graph.add((onto_uri, RDF.type, OWL.Ontology)) + graph.add((onto_uri, RDFS.label, Literal("macao-full"))) graph.serialize(RDF_FULL_FILE, "turtle", base=NS) -- GitLab