Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Codespell configuration is within setup.cfg
---
name: Codespell

on:
push:
branches: [master]
pull_request:
branches: [master]

permissions:
contents: read

jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Annotate locations with typos
uses: codespell-project/codespell-problem-matcher@v1
- name: Codespell
uses: codespell-project/actions-codespell@v2
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ At the moment, there are 1088 tests, of which:
1) (52) sht:LexicalBNode, sht:ToldBNode and sht:BNodeShapeLabel test non-blank blank nodes (`rdflib` does not preserve bnode "identity")
2) (18) sht:Import Uses ShEx 2.1 IMPORT feature -- not yet implemented (three aren't tagged)
3) (3) Uses manifest shapemap feature -- not yet implemented
4) (2) sht:relativeIRI -- this isn't a real problem, but we havent taken time to deal with this in the test harness
4) (2) sht:relativeIRI -- this isn't a real problem, but we haven't taken time to deal with this in the test harness
5) (6) `rdflib` has a parsing error when escaping single quotes. (Issue submitted, awaiting release)

As mentioned above, at the moment this is as literal an implementation of the specification as was sensible. This means, in particular, that we are less than clever when it comes to partition management.
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion ancilliary/earlreport.py → ancillary/earlreport.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

<https://github.com/hsolbrig> a foaf:Person, earl:Assertor;
foaf:name "Harold Solbrig";
foaf:title "Implementor";
foaf:title "Implementer";
foaf:homepage <https://github.com/hsolbrig> ."""

EARL = Namespace("http://www.w3.org/ns/earl#")
Expand Down
4 changes: 2 additions & 2 deletions notebooks/PrefixLib.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"\"\"\"\n",
"p = PrefixLibrary(shex, rdf=str(RDF))\n",
"\n",
"# Gives us acces to the PROV, GW and RDF namespaces\n",
"# Gives us access to the PROV, GW and RDF namespaces\n",
"print(p.PROV)\n",
"print(p.PROV.source)\n",
"print(p.GW.g117)\n",
Expand Down Expand Up @@ -280,7 +280,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## We didn't overrite RDF because it was already defined on the import statement at the top of this document.\n",
"## We didn't overwrite RDF because it was already defined on the import statement at the top of this document.\n",
"### This warning can be omitted:"
]
},
Expand Down
2 changes: 1 addition & 1 deletion notebooks/SPARQLEndpoints.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
"START=@:S1\n",
"\n",
":S1 {foaf:page IRI{3} ; # one or more foaf pages\n",
" drugbank:limsDrugId xsd:string # ane exactly one drug id\n",
" drugbank:limsDrugId xsd:string # and exactly one drug id\n",
"}\"\"\"\n",
"\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion notebooks/WikiSlurper.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
" \"erhebliche krankhafte Abweichung von der Norm im Erleben oder Verhalten\",\n",
" \"lidské onemocnění\",\n",
" \"mielen toiminnan poikkeama, joka aiheuttaa merkittävää kärsimystä ja toimintakyvyn laskua\",\n",
" \"ohälsa i psyket, det vill säga i personligheten, emotionerna eller kognitionen, vilka primärt har psykiska orsaker\",\n",
" \"ohälsa i psyket, det will säga i personligheten, emotionerna eller kognitionen, vilka primärt har psykiska orsaker\",\n",
" \"označenie pre výrazný odklon od spôsobu vnímania a správania psychicky zdravého jedinca\",\n",
" \"psigiese aandoening\",\n",
" \"psihološki poremećaj ili anomalija\",\n",
Expand Down
4 changes: 2 additions & 2 deletions pyshex/shape_expressions_language/p5_3_shape_expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def satisfies(cntxt: Context, n: Node, se: ShExJ.shapeExpr) -> bool:
satisfies(n, se2, G, m).
* Se is a ShapeAnd and for every shape expression se2 in shapeExprs, satisfies(n, se2, G, m).
* Se is a ShapeNot and for the shape expression se2 at shapeExpr, notSatisfies(n, se2, G, m).
* Se is a ShapeExternal and implementation-specific mechansims not defined in this specification
* Se is a ShapeExternal and implementation-specific mechanisms not defined in this specification
indicate success.
* Se is a shapeExprRef and there exists in the schema a shape expression se2 with that id and
satisfies(n, se2, G, m).
Expand Down Expand Up @@ -77,7 +77,7 @@ def satisfiesShapeNot(cntxt: Context, n: Node, se: ShExJ.ShapeNot, _: DebugConte

@trace_satisfies(True)
def satisfiesExternal(cntxt: Context, n: Node, se: ShExJ.ShapeExternal, c: DebugContext) -> bool:
""" Se is a ShapeExternal and implementation-specific mechansims not defined in this specification indicate
""" Se is a ShapeExternal and implementation-specific mechanisms not defined in this specification indicate
success.
"""
if c.debug:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" Implemention of `5.6 Schema Requirements <http://shex.io/shex-semantics/#schema-requirements>`_
""" Implementation of `5.6 Schema Requirements <http://shex.io/shex-semantics/#schema-requirements>`_

The semantics defined above assume two structural requirements beyond those imposed by the grammar of the
abstract syntax. These ensure referential integrity and eliminate logical paradoxes such as those that arrise
Expand Down
4 changes: 2 additions & 2 deletions pyshex/shape_expressions_language/p5_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def __init__(self, g: Optional[Graph], s: Schema,

def reset(self) -> None:
"""
Reset the context preceeding an evaluation
Reset the context preceding an evaluation
"""
self.evaluating = set()
self.assumptions = {}
Expand Down Expand Up @@ -363,7 +363,7 @@ def start_evaluating(self, n: Node, s: ShExJ.shapeExpr) -> Optional[bool]:
:return: Assumed evaluation result. If None, evaluation must be performed
"""
if not s.id:
s.id = str(BNode()) # Random permanant id
s.id = str(BNode()) # Random permanent id
key = (n, s.id)

# We only evaluate a node once
Expand Down
2 changes: 1 addition & 1 deletion pyshex/shex_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def rdf(self) -> str:

@rdf.setter
def rdf(self, rdf: Optional[Union[str, Graph]]) -> None:
""" Set the RDF DataSet to be evaulated. If ``rdf`` is a string, the presence of a return is the
""" Set the RDF DataSet to be evaluated. If ``rdf`` is a string, the presence of a return is the
indicator that it is text instead of a location.

:param rdf: File name, URL, representation of rdflib Graph
Expand Down
2 changes: 1 addition & 1 deletion pyshex/utils/datatype_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def can_cast_to(v: Literal, dt: str) -> bool:


def total_digits(n: Literal) -> Optional[int]:
""" 5.4.5 XML Schema Numberic Facet Constraints
""" 5.4.5 XML Schema Numeric Facet Constraints

totaldigits and fractiondigits constraints on values not derived from xsd:decimal fail.
"""
Expand Down
2 changes: 1 addition & 1 deletion pyshex/utils/deprecated.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

def deprecated(func):
"""This is a decorator which can be used to mark functions
as deprecated. It will result in a warning being emmitted
as deprecated. It will result in a warning being emitted
when the function is used."""
# Note: copied from https://code.activestate.com/recipes/391367-deprecated/
def newFunc(*args, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion pyshex/utils/matchesEachOfEvaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __init__(self, cntxt: Context, T: RDFGraph, expr: ShExJ.EachOf) -> None:
"""
# tripleExpr = Union["EachOf", "OneOf", "TripleConstraint", tripleExprLabel]
#
# For each tripleExpr in expressions deteremine the set of applicable predicates and their
# For each tripleExpr in expressions determine the set of applicable predicates and their
# corresponding triples.
#
# Case 1: predicate occurs in exactly one expression and expression references exactly one predicate
Expand Down
8 changes: 8 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,11 @@ packages =
console_scripts =
shexeval = pyshex.shex_evaluator:evaluate_cli


[codespell]
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
# TODO: data/ actually might benefit from some typos fixed
skip = .git*,data,WikiSlurper.ipynb
check-hidden = true
ignore-regex = ^\s*"image/\S+": ".*
ignore-words-list = te
2 changes: 1 addition & 1 deletion tests/test_primer/SPARQLEndpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
START=@:S1

:S1 {foaf:page IRI+ ; # one or more foaf pages
drugbank:limsDrugId xsd:string # ane exactly one drug id
drugbank:limsDrugId xsd:string # and exactly one drug id
}"""


Expand Down
2 changes: 1 addition & 1 deletion tests/test_pyshex_utils/test_partitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def test_large_integer_partition(self):

def test_large_filtered_integer(self):
""" The purpose of this test is to make sure that the generators work all the way through. If there
is something in the pipeline that requires complet resolution, this test will never finish. """
is something in the pipeline that requires complete resolution, this test will never finish. """
x = filtered_integer_partition(25, 20)
[next(x) for _ in range(100)]
self.assertEqual((
Expand Down
2 changes: 1 addition & 1 deletion tests/test_shextest_validation/test_manifest_shex_shexc.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from rdflib import URIRef

from ancilliary.earlreport import EARLPage
from ancillary.earlreport import EARLPage
from tests.utils.manifest_tester import ManifestEntryTestCase


Expand Down
2 changes: 1 addition & 1 deletion tests/test_support_libraries/local_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from rdflib import URIRef, XSD
from pyshex import PrefixLibrary

""" This module is used to test the PrefixLibrary's ability to inject namespaces directoy into the containing module
""" This module is used to test the PrefixLibrary's ability to inject namespaces directory into the containing module
It is used in conjunction with test_prefixlib.test_add_to_module """

pl = PrefixLibrary("""
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/manifest_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import rdflib_shim
shimin = rdflib_shim.RDFLIB_SHIM

from ancilliary.earlreport import EARLPage
from ancillary.earlreport import EARLPage
from pyshex.shape_expressions_language.p5_2_validation_definition import isValid
from pyshex.shape_expressions_language.p5_context import Context
from pyshex.shapemap_structure_and_language.p3_shapemap_structure import ShapeAssociation, FixedShapeMap, START
Expand Down