Skip to content
Snippets Groups Projects
Commit d98e15e4 authored by Eliott Sammier's avatar Eliott Sammier
Browse files

New IDE debug configs for each step

parent 5b404252
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,28 @@
"version": "0.2.0",
"configurations": [
{
"name": "Python Debugger: Current File",
"name": "Python: extract",
"type": "debugpy",
"request": "launch",
"program": "src/extract.py",
"console": "integratedTerminal"
},
{
"name": "Python: transform",
"type": "debugpy",
"request": "launch",
"program": "src/transform.py",
"console": "integratedTerminal"
},
{
"name": "Python: export",
"type": "debugpy",
"request": "launch",
"program": "src/export.py",
"console": "integratedTerminal"
},
{
"name": "Python: main",
"type": "debugpy",
"request": "launch",
"program": "src/main.py",
......
import filecmp
from re import sub
from lxml import etree
from rdflib import RDFS, Graph, Literal, URIRef
......
import re
import subprocess
from os import path
from rdflib import OWL, RDF, RDFS, Graph, Literal
......@@ -46,7 +45,6 @@ def parse_mosetp(graph: Graph, filepath: str, id: str):
:param filepath: path to the MosEtp file
:param id: text identifier of the subsection
"""
filename = path.basename(filepath)
# Prepare regex with capturing groups to match lines
regex = re.compile(r'.*new PageContenu\("(.*)", "(.*)", "(.*)", ""\);')
# The lines we need are fairly basic, grep is much faster
......
......@@ -19,6 +19,7 @@ def construct_while(g: Graph, query: str):
while True:
res = g.query(query)
if res.graph is not None and len(res.graph - g) > 0:
print(f"Constructed {len(res.graph - g)} triples")
g += res.graph
else:
break
......@@ -92,3 +93,7 @@ def main():
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)
if __name__ == "__main__":
main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment