-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #84 from pyscal/strict_triple_checking
Strict triple checking
- Loading branch information
Showing
13 changed files
with
6,187 additions
and
3,640 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import os | ||
from rdflib import Literal, URIRef | ||
from rdflib import Namespace as RDFLibNamespace | ||
from pyscal3.atoms import AttrSetter | ||
|
||
from atomrdf.network.network import OntologyNetwork | ||
|
||
class Namespace(AttrSetter, RDFLibNamespace): | ||
def __init__(self, infile, delimiter='/'): | ||
AttrSetter.__init__(self) | ||
self.network = OntologyNetwork(infile, delimiter=delimiter) | ||
#print(type(self.network.onto.tree.base_iri)) | ||
#self.namespace = RDFLibNamespace(self.network.onto.tree.base_iri) | ||
RDFLibNamespace.__init__(self.network.onto.tree.base_iri) | ||
#self.namespace = RDFLibNamespace("http://purls.helmholtz-metadaten.de/cmso/") | ||
self.name = self.network.onto.tree.name | ||
mapdict = {} | ||
|
||
#now iterate over all attributes | ||
for k1 in ['class', 'object_property', 'data_property']: | ||
for k2, val in self.network.onto.attributes[k1].items(): | ||
if val.namespace == self.name: | ||
mapdict[val.name_without_prefix] = val | ||
|
||
#add attributes | ||
self._add_attribute(mapdict) | ||
|
||
|
||
file_location = os.path.dirname(__file__) | ||
|
||
CMSO = Namespace(os.path.join(file_location, 'data/cmso.owl')) | ||
PLDO = Namespace(os.path.join(file_location, 'data/pldo.owl')) | ||
PODO = Namespace(os.path.join(file_location, 'data/podo.owl')) | ||
ASMO = Namespace(os.path.join(file_location, 'data/asmo.owl')) | ||
PROV = RDFLibNamespace("http://www.w3.org/ns/prov#") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.