Skip to content

Commit

Permalink
fixes latest pysubyt uage
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricdcc committed Aug 28, 2024
1 parent 6995503 commit 7c614f4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 99 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SHELL := /bin/bash
PYTHON = python3
PYTHON = python
TEST_PATH = ./tests/
FLAKE8_EXCLUDE = venv,.venv,.eggs,.tox,.git,__pycache__,*.pyc

Expand Down
10 changes: 5 additions & 5 deletions entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
from dotenv import load_dotenv
from pathlib import Path
from jinja2 import Environment, FileSystemLoader, BaseLoader
from pysubyt import JinjaBasedGenerator, SourceFactory, SinkFactory, Settings
from pylode import OntDoc, PylodeError, __version__ as plv
from pysubyt import JinjaBasedGenerator, SourceFactory, SinkFactory, GeneratorSettings
from pylode import OntPub, PylodeError, __version__ as plv
from pylode import (
DCTERMS,
OWL,
Expand Down Expand Up @@ -55,7 +55,7 @@ def enable_logging(logconf):
logging.config.dictConfig(yaml.load(EMBEDDED_YAML_LOGCONF, Loader=yaml.SafeLoader))
log.warning(f"logconf file '{logconf}' does not exist. Embedded logging config applied as fallback.")

def extract_pub_dict(od: OntDoc):
def extract_pub_dict(od: OntPub):
def ont_prop(ont, predicate):
value = None
for s in chain(
Expand Down Expand Up @@ -121,7 +121,7 @@ def ontopub(baseuri, nsfolder, nssub, nsname, outfolder):
nspub = dict(error=True) # this assumes things will go bad :)
#check if _draft is in the name
try: # apply pylode
od = OntDoc(outpath)
od = OntPub(outpath)
log.debug(f"> {name} --> ontology loaded to pylode from '{outpath}'")
# ask pylode to make the html
od.make_html(destination=outhtmlpath, include_css=False)
Expand Down Expand Up @@ -301,7 +301,7 @@ def vocabpub(baseuri, nsfolder, nssub, nsname, outfolder,template_path):
service = JinjaBasedGenerator(args["template_path"])
source = {"_": SourceFactory.make_source(args["input"])}
sink = SinkFactory.make_sink(args["output"], force_output=True)
settings = Settings()
settings = GeneratorSettings()
service.process(
args["template_name"],
source,
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ jinja2
python-dotenv
flake8
pytest
git+https://github.com/vliz-be-opsci/pysubyt.git@4518e4f#egg=pysubyt
pysubyt
92 changes: 0 additions & 92 deletions tests/new_out/onto-one.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -42,98 +42,6 @@ tst1:CClass1
rdfs:comment "Concept Class Test for onto-one."@en ;
rdfs:label "ConceptClass#1"@en ;
rdfs:subClassOf dc:Location, skos:Concept .
<https://example.org/pylode2pages-test/onto-one#1>
rdf:type skos:Concept ;
dc:date "2016-01-01" ;
dc:identifier "1" ;
skos:prefLabel "Abdominal pain"@en ;
skos:broader <https://example.org/pylode2pages-test/onto-one#4> ,;
skos:narrower <https://example.org/pylode2pages-test/onto-one#2> ,;
skos:definition "Pain in the region of the abdomen. It is a common complaint and has many causes."@en ;

.

<https://example.org/pylode2pages-test/onto-one#2>
rdf:type skos:Concept ;
dc:date "2017-01-01" ;
dc:identifier "2" ;
skos:prefLabel "Rectum"@en ;
skos:broader <https://example.org/pylode2pages-test/onto-one#4> ,;
skos:definition "bodypart that is responsible for excretion of feces"@en ;

.

<https://example.org/pylode2pages-test/onto-one#3>
rdf:type skos:Concept ;
dc:date "2018-01-02" ;
dc:identifier "3" ;
skos:prefLabel "Spine"@en ;
skos:broader <https://example.org/pylode2pages-test/onto-one#4> ,;
skos:narrower <https://example.org/pylode2pages-test/onto-one#2> ,;
skos:definition "bodypart most people don't have "@en ;
skos:altLabel "Back"
.

<https://example.org/pylode2pages-test/onto-one#4>
rdf:type skos:Concept ;
dc:date "2017-02-28" ;
dc:identifier "4" ;
skos:prefLabel "Body"@en ;
skos:narrower <https://example.org/pylode2pages-test/onto-one#3> , <https://example.org/pylode2pages-test/onto-one#2> , <https://example.org/pylode2pages-test/onto-one#1> ,;
skos:definition " the physical structure of a person or an animal."@en ;

.

<https://example.org/pylode2pages-test/onto-one#5>
rdf:type skos:Concept ;
dc:date "2019-01-31" ;
dc:identifier "5" ;
skos:prefLabel "No Def"@en ;
skos:broader <https://example.org/pylode2pages-test/onto-one#4> ,;
skos:narrower <https://example.org/pylode2pages-test/onto-one#2> , <https://example.org/pylode2pages-test/onto-one#1> ,;

skos:altLabel "no definition"
.

<https://example.org/pylode2pages-test/onto-one#6>
rdf:type skos:Concept ;
dc:date "2017-12-12" ;
dc:identifier "6" ;
skos:prefLabel "example one"@en ;
skos:definition " just an example"@en ;
skos:altLabel " ex1"
.

<https://example.org/pylode2pages-test/onto-one#7>
rdf:type skos:Concept ;
dc:date "2017-12-23" ;
dc:identifier "7" ;
skos:prefLabel "example two"@en ;
skos:narrower <https://example.org/pylode2pages-test/onto-one#6> ,;
skos:definition " just example 2"@en ;

.

<https://example.org/pylode2pages-test/onto-one#8>
rdf:type skos:Concept ;
dc:date "2015-12-14" ;
dc:identifier "8" ;
skos:prefLabel "example three"@en ;
skos:broader <https://example.org/pylode2pages-test/onto-one#5> ,;
skos:narrower <https://example.org/pylode2pages-test/onto-one#6> , <https://example.org/pylode2pages-test/onto-one#7> ,;


.

<https://example.org/pylode2pages-test/onto-one#9>
rdf:type skos:Concept ;
dc:date "1996-01-03" ;
dc:identifier "9" ;
skos:prefLabel "test"@en ;


.

<https://example.org/pylode2pages-test/onto-one#10>
rdf:type skos:Concept ;
dc:date "2000-01-01" ;
Expand Down

0 comments on commit 7c614f4

Please sign in to comment.