diff --git a/tetras_extraction/macao_12/script/src/common.py b/tetras_extraction/macao_12/script/src/common.py index 73cb9c7469e7d5a6226e0c347ed0d3557757740b..3404002979c4d64b093ad386e15246d0411ceb46 100644 --- a/tetras_extraction/macao_12/script/src/common.py +++ b/tetras_extraction/macao_12/script/src/common.py @@ -27,10 +27,14 @@ SOURCE_DIR = env_path_or_rel_default( """Path to the Macao source directory (i.e. the one with the manifest)""" RESULT_DIR = env_path_or_rel_default("RESULTS_DIR", "../../result") """Path to the output directory""" -RESULT_FILE = env_path_or_rel_default("RESULT_FILE", RESULT_DIR + "/macao_content.ttl") -"""Path to the Turtle output file""" -SCHEMA_FILE = env_path_or_rel_default("SCHEMA_FILE", "../../macao_schema.ttl") +RDF_CONTENT_FILE = env_path_or_rel_default( + "RDF_CONTENT_FILE", RESULT_DIR + "/macao_content.ttl" +) +"""Path to the file containing the extracted content""" +RDF_SCHEMA_FILE = env_path_or_rel_default("RDF_SCHEMA_FILE", "../../macao_schema.ttl") """Path to the schema file""" +RDF_FULL_FILE = env_path_or_rel_default("RDF_FULL_FILE", RESULT_DIR + "/macao_full.ttl") +"""Path to the full RDF file, including schema, extracted content and inferences""" NS = Namespace("http://www.semanticweb.org/eliott/ontologies/2024/4/macao/") """The rdflib base Namespace for our ontology""" diff --git a/tetras_extraction/macao_12/script/src/export.py b/tetras_extraction/macao_12/script/src/export.py index 93d083f289df0a4ee25147aff52fc90612e1c382..9c08d164847be8aaab9066865ba911fac888a7a7 100644 --- a/tetras_extraction/macao_12/script/src/export.py +++ b/tetras_extraction/macao_12/script/src/export.py @@ -40,8 +40,8 @@ def main(): graph = Graph() ld = Load.create(graph) Property.set(Property.Value.DISABLE_OWL_AUTO_IMPORT, True) - ld.parse(SCHEMA_FILE) - ld.parse(RESULT_FILE) + ld.parse(RDF_SCHEMA_FILE) + ld.parse(RDF_CONTENT_FILE) # Run STTL transformation tr = Transformer.create(graph, MODULE_DIR + "/../templates/") diff --git a/tetras_extraction/macao_12/script/src/extract.py b/tetras_extraction/macao_12/script/src/extract.py index cdf234629a5ad2637c111481a12183312b103832..12133eb1e9f130431efdaad9fc589ec9210b7e33 100644 --- a/tetras_extraction/macao_12/script/src/extract.py +++ b/tetras_extraction/macao_12/script/src/extract.py @@ -38,8 +38,8 @@ def export_graph(g: Graph): g.add((this_onto, RDF.type, OWL.Ontology)) g.add((this_onto, RDFS.label, Literal("macao-content"))) g.add((this_onto, OWL.imports, schema_ontology_uri)) - g.serialize(RESULT_FILE, "turtle", base=NS) - log.info(f"Exported {len(g)} triples to {RESULT_FILE}.") + g.serialize(RDF_CONTENT_FILE, "turtle", base=NS) + log.info(f"Exported {len(g)} triples to {RDF_CONTENT_FILE}.") def ns_find(elem: etree._Element, query: str):