-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
72 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,12 +8,12 @@ def read(file_path): | |
setup( | ||
name = 'shexer', | ||
packages = find_packages(exclude=["*.local_code.*"]), # this must be the same as the name above | ||
version = '2.5.5', | ||
version = '2.5.6', | ||
description = 'Automatic schema extraction for RDF graphs', | ||
author = 'Daniel Fernandez-Alvarez', | ||
author_email = '[email protected]', | ||
url = 'https://github.com/DaniFdezAlvarez/shexer', | ||
download_url = 'https://github.com/DaniFdezAlvarez/shexer/archive/2.5.5.tar.gz', | ||
download_url = 'https://github.com/DaniFdezAlvarez/shexer/archive/2.5.6.tar.gz', | ||
keywords = ['testing', 'shexer', 'shexerp3', "rdf", "shex", "shacl", "schema"], | ||
long_description = read('README.md'), | ||
long_description_content_type='text/markdown', | ||
|
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,33 @@ | ||
from shexer.core.instances.abstract_instance_tracker import _RDF_TYPE, _RDFS_SUBCLASS_OF | ||
from shexer.core.instances.instance_tracker import InstanceTracker | ||
from shexer.consts import SHAPES_DEFAULT_NAMESPACE | ||
from shexer.model.bnode import BNode | ||
from shexer.core.instances.pconsts import _S | ||
|
||
|
||
class EndpointInstanceTracker(InstanceTracker): | ||
|
||
def __init__(self, target_classes, triples_yielder, instantiation_property=_RDF_TYPE, all_classes_mode=False, | ||
subclass_property=_RDFS_SUBCLASS_OF, track_hierarchies=True, shape_qualifiers_mode=False, | ||
namespaces_for_qualifier_props=None, shapes_namespace=SHAPES_DEFAULT_NAMESPACE, instances_cap=-1): | ||
super().__init__(target_classes=target_classes, | ||
triples_yielder=triples_yielder, | ||
instantiation_property=instantiation_property, | ||
all_classes_mode=all_classes_mode, | ||
subclass_property=subclass_property, | ||
track_hierarchies=track_hierarchies, | ||
shape_qualifiers_mode=shape_qualifiers_mode, | ||
namespaces_for_qualifier_props=namespaces_for_qualifier_props, | ||
shapes_namespace=shapes_namespace, | ||
instances_cap=instances_cap) | ||
|
||
def _yield_relevant_triples(self): | ||
for a_triple in self._triples_yielder.yield_triples(): | ||
if self._annotator.is_relevant_triple(a_triple) and self._subject_is_not_bnode(a_triple): | ||
self._relevant_triples += 1 | ||
yield a_triple | ||
else: | ||
self._not_relevant_triples += 1 | ||
|
||
def _subject_is_not_bnode(self, a_triple): | ||
return not isinstance(a_triple[_S], BNode) |
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
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