shexspec / grammar-python-antlr Goto Github PK
View Code? Open in Web Editor NEWPython Antlr ShExC parser
License: MIT License
Python Antlr ShExC parser
License: MIT License
I had to add chardet to my project (coming from https://github.com/SuLab/WikidataIntegrator and going down dependencies).
When using rdflib 6.2 and pyshex 0.8.1, I get a DeprecationWarning
from pyshexc
because rdflib-jsonld
is deprecated.
>>> import rdflib
>>> import pyshex
/home/stain/miniconda3/envs/validate/lib/python3.11/site-packages/rdflib_jsonld/__init__.py:9:
DeprecationWarning: The rdflib-jsonld package has been integrated into rdflib as of rdflib==6.0.0. Please remove rdflib-jsonld from your project's dependencies.
warnings.warn(
>>> rdflib.__version__
'6.2.0'
This is caused by pyshexc/rdflib/contextcache.py
from rdflib_jsonld import util
This means my command line tool that uses pyshex
always outputs the warning, but I have no control over its import of rdflib_jsonld
. This also affects PyShex' command line tool shexeval
There is no way to turn off the warnings with warnings.filterwarning
, as rdflib_jsonld
rudely overrides the warnings manager using warnings.catch_warnings
.
In [1]: import sys
...: from pyshexc.parser_impl.generate_shexj import generate
...:
...: generate(['shexset/molbio/E37'])
RDFLib Version: 5.0.0
ANTLR runtime and generated code versions disagree: 4.9!=4.7.2
ANTLR runtime and generated code versions disagree: 4.9!=4.7.2
JSON output written to shexset/molbioE37.json
turtle output written to shexset/molbioE37.ttl
PR in preparation.
The 0.8 branch of PyShEx has dropped support for Python 3.6 and earlier. This turns out to be a real problem for the wikidataintegrator, so we need to re-introduce 3.6 support
Running produces:
The ANTLR has to match the runtime -- the Pipfile requirements must include minor version:
ANTLR runtime and generated code versions disagree: 4.8!=4.7.1
Same as:
hsolbrig/PyShEx#67
hsolbrig/PyShEx#65
ralf@ark:~/wikidata/grammar-python-antlr/scripts> . genpython.sh
cp: cannot stat '../../grammar/ShExDoc.g4': No such file or directory
error(7): cannot find or open file: ShExDoc.g4
rm: cannot remove 'ShExDoc.g4': No such file or directory
Why is this script reaching outside the repo directory? Where do I get ShExDoc.g4 ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.