Skip to content

Commit f9f4cf7

Browse files
committed
rm comments
1 parent 8878eae commit f9f4cf7

3 files changed

Lines changed: 1 addition & 43 deletions

File tree

kgforge/specializations/models/rdf/rdf_model_service.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ def __init__(self, graph: Graph, context_iri: Optional[str] = None) -> None:
4040
self._graph = graph
4141
self._context_cache = dict()
4242
self.schema_to_source, self.classes_to_shapes = self._build_shapes_map()
43-
# self.label_to_ontology_id: Dict[str, URIRef] = self._build_ontology_map()
44-
4543
self.context = Context(self.resolve_context(context_iri), context_iri)
4644
self.types_to_shapes: Dict[str, URIRef] = self._build_types_to_shapes()
4745

@@ -185,7 +183,3 @@ def traverse_properties(properties) -> Tuple[Dict, Dict]:
185183
context.update({key: terms[key] for key in sorted(terms)})
186184

187185
return {"@context": context} if len(context) > 0 else None
188-
189-
# @abstractmethod
190-
# def _build_ontology_map(self):
191-
# pass

kgforge/specializations/models/rdf/rdf_model_service_from_directory.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,7 @@ def resolve_context(self, iri: str) -> Dict:
5858
def generate_context(self) -> Dict:
5959
return self._generate_context()
6060

61-
# def _build_ontology_map(self) -> Dict[str, URIRef]:
62-
# query = """
63-
# PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
64-
# PREFIX sh: <http://www.w3.org/ns/shacl#>
65-
# SELECT ?id ?label WHERE {
66-
# ?id a owl:Class ;
67-
# rdfs:label ?label
68-
# }
69-
# """ # TODO CHANGE
70-
# res = self._graph.query(query)
71-
# return {
72-
# row["label"]: URIRef(row["id"])
73-
# for row in res
74-
# }
61+
7562

7663
def _build_shapes_map(self) -> Tuple[Dict[URIRef, str], Dict[str, URIRef]]:
7764
query = """

kgforge/specializations/models/rdf/rdf_model_service_from_store.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -172,26 +172,3 @@ def _load_shape_and_reload_shapes_graph(self, iri: URIRef):
172172
# reloads the shapes graph
173173
self._shapes_graph = ShapesGraphWrapper(self._graph)
174174

175-
# def _build_ontology_map(self):
176-
# query = """
177-
# PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
178-
# PREFIX sh: <http://www.w3.org/ns/shacl#>
179-
# SELECT ?id ?label WHERE {
180-
# ?id a owl:Class ;
181-
# rdfs:label ?label
182-
# }
183-
# """
184-
# # make sure to get all types
185-
# limit = 100
186-
# offset = 0
187-
# count = limit
188-
# class_resource: Dict[URIRef, URIRef] = dict()
189-
#
190-
# while count == limit:
191-
# resources = self.context_store.sparql(query, debug=False, limit=limit, offset=offset)
192-
# for r in resources:
193-
# class_resource[r.label] = URIRef(r.id)
194-
# count = len(resources)
195-
# offset += count
196-
#
197-
# return class_resource

0 commit comments

Comments
 (0)