Skip to content

Commit

Permalink
running on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholascar committed Dec 22, 2024
1 parent 5e9d64b commit 88b37b5
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 22 deletions.
10 changes: 5 additions & 5 deletions manifest/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
from rdflib import DCAT, DCTERMS, PROF, RDF, SDO, SKOS
from rdflib import Graph, URIRef, Dataset

from ns_mrr import MRR
from ns_olis import OLIS
from validator import validate
from kurrawong.format import make_quads
from manifest.ns_mrr import MRR
from manifest.ns_olis import OLIS
from manifest.validator import validate
from kurrawong.format import make_dataset
from kurrawong.utils import load_graph

__version__ = "1.0.0"
Expand All @@ -33,7 +33,7 @@
def export_quads(
g: Graph, dataset_iri: URIRef, destination_path: Optional[Path] = None
):
d = make_quads(g, dataset_iri)
d = make_dataset(g, dataset_iri)
d.bind("reg", "http://purl.org/linked-data/registry#")
d.bind("olis", OLIS)

Expand Down
1 change: 1 addition & 0 deletions manifest/tests/run-fuseki.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker run --rm --env=ADMIN_PASSWORD=admin --volume=fuseki/configuration:/fuseki-base/configuration --volume=fuseki/databases:/fuseki-base/databases -p 3030:3030 --name mani secoresearch/fuseki:5.1.0
19 changes: 17 additions & 2 deletions manifest/tests/test_loader.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
from manifest.loader import load
from pathlib import Path
from rdflib import Dataset, URIRef


def test_load_01():
manifest = Path(__file__).parent / "demo-vocabs" / "manifest.ttl"
results_file = Path(__file__).parent / "results.trig"
print()
print(load(manifest, sparql_endpoint=None, export_quads_file=results_file))

load(manifest, sparql_endpoint=None, export_quads_file=results_file)

# load the resultant Dataset to test it
d = Dataset()
d.parse(results_file, format="trig")

graph_ids = [x.identifier for x in d.graphs()]

assert URIRef("https://example.com/demo-vocabs-catalogue") in graph_ids
assert URIRef("https://example.com/demo-vocabs/image-test") in graph_ids
assert URIRef("https://example.com/demo-vocabs/language-test") in graph_ids
assert URIRef("http://background") in graph_ids
assert URIRef("https://olis.dev/SystemGraph") in graph_ids

Path(results_file).unlink()
1 change: 0 additions & 1 deletion manifest/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import sys
from pathlib import Path
from typing import Union

import httpx
from kurrawong.utils import load_graph
Expand Down
26 changes: 13 additions & 13 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ name = "prez.dev"
version = "0.1.0"
description = ""
authors = ["Nicholas Car <[email protected]>"]
package-mode = false

[tool.poetry.dependencies]
python = "^3.11"
mkdocs-material = "^8.3.9"
pyshacl = "^0.29.0"
kurrawong = {path = "/Users/nick/work/kurrawong/kurrawong-python", develop = true}
kurrawong = {path = "/home/nick/work/kurrawong/kurrawong-python", develop = true}

[tool.poetry.dev-dependencies]

Expand Down

0 comments on commit 88b37b5

Please sign in to comment.