Skip to content

Commit

Permalink
better RDF schema error handling (common-workflow-language#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-c committed May 24, 2016
1 parent 3b8dc09 commit 84738f1
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
5 changes: 5 additions & 0 deletions schema_salad/ref_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from .aslist import aslist
import rdflib
from rdflib.namespace import RDF, RDFS, OWL
from rdflib.plugins.parsers.notation3 import BadSyntax
import xml.sax
from typing import cast, Union, Tuple, Dict, Any, Callable, Iterable

Expand Down Expand Up @@ -160,6 +161,10 @@ def add_schemas(self, ns, base_url):
break
except xml.sax.SAXParseException: # type: ignore
pass
except TypeError:
pass
except BadSyntax:
pass

for s, _, _ in self.graph.triples((None, RDF.type, RDF.Property)):
self._add_properties(s)
Expand Down
4 changes: 4 additions & 0 deletions typeshed/2.7/rdflib/plugins/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Stubs for rdflib.plugins (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.

4 changes: 4 additions & 0 deletions typeshed/2.7/rdflib/plugins/parsers/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Stubs for rdflib.plugins.parsers (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.

12 changes: 12 additions & 0 deletions typeshed/2.7/rdflib/plugins/parsers/notation3.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Stubs for rdflib.plugins.parsers.notation3 (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.

from typing import Any
from rdflib.parser import Parser

class BadSyntax(SyntaxError):
lines = ... # type: Any
def __init__(self, uri, lines, argstr, i, why): ...
@property
def message(self): ...

0 comments on commit 84738f1

Please sign in to comment.