Skip to content

Commit

Permalink
Merge pull request #84 from jamiefeiss/remove-calling-term
Browse files Browse the repository at this point in the history
Removed calling .term()
  • Loading branch information
ashleysommer authored Jul 20, 2021
2 parents 0dab3ad + dd8f3b9 commit 29b7ad7
Show file tree
Hide file tree
Showing 24 changed files with 200 additions and 200 deletions.
14 changes: 7 additions & 7 deletions pyshacl/constraints/constraint_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,13 +280,13 @@ def _format_sparql_based_result_message(self, msg, bound_vars):
return msg


SH_nodeValidator = SH.term('nodeValidator')
SH_propertyValidator = SH.term('propertyValidator')
SH_validator = SH.term('validator')
SH_optional = SH.term('optional')
SH_SPARQLSelectValidator = SH.term('SPARQLSelectValidator')
SH_SPARQLAskValidator = SH.term('SPARQLAskValidator')
SH_JSValidator = SH.term('JSValidator')
SH_nodeValidator = SH.nodeValidator
SH_propertyValidator = SH.propertyValidator
SH_validator = SH.validator
SH_optional = SH.optional
SH_SPARQLSelectValidator = SH.SPARQLSelectValidator
SH_SPARQLAskValidator = SH.SPARQLAskValidator
SH_JSValidator = SH.JSValidator


class CustomConstraintComponentFactory(object):
Expand Down
10 changes: 5 additions & 5 deletions pyshacl/constraints/core/cardinality_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
from pyshacl.rdfutil import stringify_node


XSD_integer = XSD.term('integer')
SH_minCount = SH.term('minCount')
SH_maxCount = SH.term('maxCount')
XSD_integer = XSD.integer
SH_minCount = SH.minCount
SH_maxCount = SH.maxCount

SH_MinCountConstraintComponent = SH.term('MinCountConstraintComponent')
SH_MaxCountConstraintComponent = SH.term('MaxCountConstraintComponent')
SH_MinCountConstraintComponent = SH.MinCountConstraintComponent
SH_MaxCountConstraintComponent = SH.MaxCountConstraintComponent


class MinCountConstraintComponent(ConstraintComponent):
Expand Down
18 changes: 9 additions & 9 deletions pyshacl/constraints/core/logical_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
from pyshacl.rdfutil import stringify_node


SH_not = SH.term('not')
SH_and = SH.term('and')
SH_or = SH.term('or')
SH_xone = SH.term('xone')

SH_NotConstraintComponent = SH.term('NotConstraintComponent')
SH_AndConstraintComponent = SH.term('AndConstraintComponent')
SH_OrConstraintComponent = SH.term('OrConstraintComponent')
SH_XoneConstraintComponent = SH.term('XoneConstraintComponent')
SH_not = SH["not"]
SH_and = SH["and"]
SH_or = SH["or"]
SH_xone = SH.xone

SH_NotConstraintComponent = SH.NotConstraintComponent
SH_AndConstraintComponent = SH.AndConstraintComponent
SH_OrConstraintComponent = SH.OrConstraintComponent
SH_XoneConstraintComponent = SH.XoneConstraintComponent


class NotConstraintComponent(ConstraintComponent):
Expand Down
16 changes: 8 additions & 8 deletions pyshacl/constraints/core/other_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
from pyshacl.rdfutil import stringify_node


SH_InConstraintComponent = SH.term('InConstraintComponent')
SH_ClosedConstraintComponent = SH.term('ClosedConstraintComponent')
SH_HasValueConstraintComponent = SH.term('HasValueConstraintComponent')
SH_in = SH.term('in')
SH_closed = SH.term('closed')
SH_ignoredProperties = SH.term('ignoredProperties')
SH_hasValue = SH.term('hasValue')
SH_InConstraintComponent = SH.InConstraintComponent
SH_ClosedConstraintComponent = SH.ClosedConstraintComponent
SH_HasValueConstraintComponent = SH.HasValueConstraintComponent
SH_in = SH["in"]
SH_closed = SH.closed
SH_ignoredProperties = SH.ignoredProperties
SH_hasValue = SH.hasValue


class InConstraintComponent(ConstraintComponent):
Expand Down Expand Up @@ -98,7 +98,7 @@ class ClosedConstraintComponent(ConstraintComponent):

shacl_constraint_component = SH_ClosedConstraintComponent

ALWAYS_IGNORE = {(RDF_type, RDFS.term('Resource'))}
ALWAYS_IGNORE = {(RDF_type, RDFS.Resource)}

def __init__(self, shape):
super(ClosedConstraintComponent, self).__init__(shape)
Expand Down
18 changes: 9 additions & 9 deletions pyshacl/constraints/core/property_pair_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
from pyshacl.rdfutil import stringify_node


SH_equals = SH.term('equals')
SH_disjoint = SH.term('disjoint')
SH_lessThan = SH.term('lessThan')
SH_lessThanOrEquals = SH.term('lessThanOrEquals')

SH_EqualsConstraintComponent = SH.term('EqualsConstraintComponent')
SH_DisjointConstraintComponent = SH.term('DisjointConstraintComponent')
SH_LessThanConstraintComponent = SH.term('LessThanConstraintComponent')
SH_LessThanOrEqualsConstraintComponent = SH.term('LessThanOrEqualsConstraintComponent')
SH_equals = SH.equals
SH_disjoint = SH.disjoint
SH_lessThan = SH.lessThan
SH_lessThanOrEquals = SH.lessThanOrEquals

SH_EqualsConstraintComponent = SH.EqualsConstraintComponent
SH_DisjointConstraintComponent = SH.DisjointConstraintComponent
SH_LessThanConstraintComponent = SH.LessThanConstraintComponent
SH_LessThanOrEqualsConstraintComponent = SH.LessThanOrEqualsConstraintComponent


class EqualsConstraintComponent(ConstraintComponent):
Expand Down
18 changes: 9 additions & 9 deletions pyshacl/constraints/core/shape_based_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@
from pyshacl.rdfutil import stringify_node


SH_PropertyConstraintComponent = SH.term('PropertyConstraintComponent')
SH_NodeConstraintComponent = SH.term('NodeConstraintComponent')
SH_PropertyConstraintComponent = SH.PropertyConstraintComponent
SH_NodeConstraintComponent = SH.NodeConstraintComponent

SH_QualifiedValueCountConstraintComponent = SH.term('QualifiedValueConstraintComponent')
SH_QualifiedMaxCountConstraintComponent = SH.term('QualifiedMaxCountConstraintComponent')
SH_QualifiedMinCountConstraintComponent = SH.term('QualifiedMinCountConstraintComponent')
SH_QualifiedValueCountConstraintComponent = SH.QualifiedValueConstraintComponent
SH_QualifiedMaxCountConstraintComponent = SH.QualifiedMaxCountConstraintComponent
SH_QualifiedMinCountConstraintComponent = SH.QualifiedMinCountConstraintComponent

SH_qualifiedValueShape = SH.term('qualifiedValueShape')
SH_qualifiedValueShapesDisjoint = SH.term('qualifiedValueShapesDisjoint')
SH_qualifiedMinCount = SH.term('qualifiedMinCount')
SH_qualifiedMaxCount = SH.term('qualifiedMaxCount')
SH_qualifiedValueShape = SH.qualifiedValueShape
SH_qualifiedValueShapesDisjoint = SH.qualifiedValueShapesDisjoint
SH_qualifiedMinCount = SH.qualifiedMinCount
SH_qualifiedMaxCount = SH.qualifiedMaxCount


class PropertyConstraintComponent(ConstraintComponent):
Expand Down
22 changes: 11 additions & 11 deletions pyshacl/constraints/core/string_based_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
from pyshacl.rdfutil import stringify_node


SH_PatternConstraintComponent = SH.term('PatternConstraintComponent')
SH_MinLengthConstraintComponent = SH.term('MinLengthConstraintComponent')
SH_MaxLengthConstraintComponent = SH.term('MaxLengthConstraintComponent')
SH_LanguageInConstraintComponent = SH.term('LanguageInConstraintComponent')
SH_UniqueLangConstraintComponent = SH.term('UniqueLangConstraintComponent')
SH_pattern = SH.term('pattern')
SH_flags = SH.term('flags')
SH_minLength = SH.term('minLength')
SH_maxLength = SH.term('maxLength')
SH_languageIn = SH.term('languageIn')
SH_uniqueLang = SH.term('uniqueLang')
SH_PatternConstraintComponent = SH.PatternConstraintComponent
SH_MinLengthConstraintComponent = SH.MinLengthConstraintComponent
SH_MaxLengthConstraintComponent = SH.MaxLengthConstraintComponent
SH_LanguageInConstraintComponent = SH.LanguageInConstraintComponent
SH_UniqueLangConstraintComponent = SH.UniqueLangConstraintComponent
SH_pattern = SH.pattern
SH_flags = SH.flags
SH_minLength = SH.minLength
SH_maxLength = SH.maxLength
SH_languageIn = SH.languageIn
SH_uniqueLang = SH.uniqueLang


class StringBasedConstraintBase(ConstraintComponent):
Expand Down
26 changes: 13 additions & 13 deletions pyshacl/constraints/core/value_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@
from pyshacl.rdfutil import stringify_node


RDF_langString = RDF.term('langString')
XSD_string = XSD.term('string')
XSD_integer = XSD.term('integer')
XSD_float = XSD.term('float')
XSD_boolean = XSD.term('boolean')
XSD_date = XSD.term('date')
XSD_time = XSD.term('time')
XSD_dateTime = XSD.term('dateTime')

SH_class = SH.term('class')
SH_ClassConstraintComponent = SH.term('ClassConstraintComponent')
SH_DatatypeConstraintComponent = SH.term('DatatypeConstraintComponent')
SH_NodeKindConstraintComponent = SH.term('NodeKindConstraintComponent')
RDF_langString = RDF.langString
XSD_string = XSD.string
XSD_integer = XSD.integer
XSD_float = XSD.float
XSD_boolean = XSD.boolean
XSD_date = XSD.date
XSD_time = XSD.time
XSD_dateTime = XSD.dateTime

SH_class = SH["class"]
SH_ClassConstraintComponent = SH.ClassConstraintComponent
SH_DatatypeConstraintComponent = SH.DatatypeConstraintComponent
SH_NodeKindConstraintComponent = SH.NodeKindConstraintComponent


class ClassConstraintComponent(ConstraintComponent):
Expand Down
16 changes: 8 additions & 8 deletions pyshacl/constraints/core/value_range_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
from pyshacl.rdfutil.compare import compare_literal


SH_MinExclusiveConstraintComponent = SH.term('MinExclusiveConstraintComponent')
SH_MinInclusiveConstraintComponent = SH.term('MinInclusiveConstraintComponent')
SH_minExclusive = SH.term('minExclusive')
SH_minInclusive = SH.term('minInclusive')
SH_MaxExclusiveConstraintComponent = SH.term('MaxExclusiveConstraintComponent')
SH_MaxInclusiveConstraintComponent = SH.term('MaxInclusiveConstraintComponent')
SH_maxExclusive = SH.term('maxExclusive')
SH_maxInclusive = SH.term('maxInclusive')
SH_MinExclusiveConstraintComponent = SH.MinExclusiveConstraintComponent
SH_MinInclusiveConstraintComponent = SH.MinInclusiveConstraintComponent
SH_minExclusive = SH.minExclusive
SH_minInclusive = SH.minInclusive
SH_MaxExclusiveConstraintComponent = SH.MaxExclusiveConstraintComponent
SH_MaxInclusiveConstraintComponent = SH.MaxInclusiveConstraintComponent
SH_maxExclusive = SH.maxExclusive
SH_maxInclusive = SH.maxInclusive


class MinExclusiveConstraintComponent(ConstraintComponent):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
from pyshacl.shapes_graph import ShapesGraph


SH_SPARQLSelectValidator = SH.term('SPARQLSelectValidator')
SH_SPARQLAskValidator = SH.term('SPARQLAskValidator')
SH_SPARQLSelectValidator = SH.SPARQLSelectValidator
SH_SPARQLAskValidator = SH.SPARQLAskValidator


class BoundShapeValidatorComponent(ConstraintComponent):
Expand Down
4 changes: 2 additions & 2 deletions pyshacl/constraints/sparql/sparql_based_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
from pyshacl.pytypes import GraphLike


SH_sparql = SH.term('sparql')
SH_SPARQLConstraintComponent = SH.term('SPARQLConstraintComponent')
SH_sparql = SH.sparql
SH_SPARQLConstraintComponent = SH.SPARQLConstraintComponent


class SPARQLBasedConstraint(ConstraintComponent):
Expand Down
Loading

0 comments on commit 29b7ad7

Please sign in to comment.