Skip to content

Commit

Permalink
edits, update prefix.cc.json
Browse files Browse the repository at this point in the history
  • Loading branch information
muddymudskipper committed Jul 22, 2024
1 parent 9e7f37d commit 36a97b1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
11 changes: 5 additions & 6 deletions cmem_plugin_shapes/plugin_shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,9 @@ def get_class_dict(self) -> dict:

def make_shapes(self, shapes_graph: Graph) -> Graph:
"""Make shapes"""
prop_uuids = []
class_uuids = []
class_dict = self.get_class_dict()
for cls, props in class_dict.items():
prop_uuids = []
for cls, props in self.get_class_dict().items():
class_uuid = uuid5(NAMESPACE_URL, cls)
node_shape_uri = URIRef(f"{format_namespace(self.shapes_graph_iri)}{class_uuid}")
if class_uuid not in class_uuids:
Expand Down Expand Up @@ -250,12 +249,12 @@ def import_shapes_graph(self) -> None:

def execute(self, inputs: tuple, context: ExecutionContext) -> None: # noqa: ARG002
"""Execute plugin"""
self.context = context
setup_cmempy_user_access(context.user)
self.dp_api_endpoint = get_dp_api_endpoint()
self.prefixes = self.get_prefixes()
if not self.overwrite and self.shapes_graph_iri in [i["iri"] for i in get_graphs_list()]:
raise ValueError(f"Graph <{self.shapes_graph_iri}> already exists")
self.context = context
self.dp_api_endpoint = get_dp_api_endpoint()
self.prefixes = self.get_prefixes()
shapes_graph = self.init_shapes_graph()
shapes_graph = self.make_shapes(shapes_graph)
nt_file = BytesIO(shapes_graph.serialize(format="nt", encoding="utf-8"))
Expand Down
6 changes: 4 additions & 2 deletions cmem_plugin_shapes/prefix.cc.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"adw": "https://animaldiversity.org/accounts/",
"aec3po": "https://w3id.org/lbd/aec3po/",
"aeo": "http://purl.obolibrary.org/obo/AEO_",
"aero": "http://purl.obolibrary.org/obo/AERO_",
"aerols": "http://xmlns.com/aerols/0.1/",
"aers": "http://aers.data2semantics.org/resource/",
"aersv": "http://aers.data2semantics.org/vocab/",
Expand Down Expand Up @@ -92,6 +93,7 @@
"apf": "http://jena.apache.org/ARQ/property#",
"api": "http://purl.org/linked-data/api/vocab#",
"apivc": "http://purl.org/linked-data/api/vocab#",
"apmwg": "http://apmwg.ovh/",
"apo": "http://purl.obolibrary.org/obo/APO_",
"apods": "http://activitypods.org/ns/core#",
"apollosv": "http://purl.obolibrary.org/obo/APOLLO_SV_",
Expand Down Expand Up @@ -1037,7 +1039,7 @@
"gg": "http://www.gemeentegeschiedenis.nl/gg-schema#",
"ggbn": "http://data.ggbn.org/schemas/ggbn/terms/",
"ghga": "http://w3id.org/ghga/",
"gist": "https://ontologies.semanticarts.com/o/gistCore#",
"gist": "http://ontologies.semanticarts.com/gist#",
"giving": "http://ontologi.es/giving#",
"gl": "http://schema.geolink.org/",
"gldp": "http://www.w3.org/ns/people#",
Expand Down Expand Up @@ -1085,7 +1087,7 @@
"gridworks": "http://purl.org/net/opmv/types/gridworks#",
"grs": "http://www.georss.org/georss/",
"grscicoll": "https://www.gbif.org/grscicoll/collection/",
"gs1": "http://gs1.org/voc/",
"gs1": "https://ref.gs1.org/voc/",
"gso": "http://www.w3.org/2006/gen/ont#",
"gsp": "http://www.opengis.net/ont/geosparql#",
"gt": "https://vocab.eccenca.com/geniustex/",
Expand Down

0 comments on commit 36a97b1

Please sign in to comment.