Comments (9)
I ran into the issue because I wanted to use the SHACL file at http://datashapes.org/schema to help validate schema.org data instances. I am not sure why or how it is using the SPARQLFunction feature, but assuming it is required for this purpose and considering that schema.org is mainstream, I am not sure if it can be defined as niche.
In any case, something to consider and perhaps keep an eye out for someone willing to implement it for pySHACL.
It would appear that the shaclvalidate tool at https://repo1.maven.org/maven2/org/topbraid/shacl/1.3.2/ implements the feature so there is a solid reference implementation out there which should help anyone who takes on the task.
from pyshacl.
I've had a one-person 13 hour codeathon tonight and fully implemented SHACLFunction
and SPARQLFunction
in pyshacl (as well as some other advanced spec features)
Can you please try pyshacl v0.13.0 and let me know if it fixes your problem?
Closed by cc3d291
from pyshacl.
The SPARQLFunction feature from the SHACL Advanced Spec is very complex, it would take a lot of effort to implement correctly in PySHACL. It seems to me to be a very niche feature that not many users would need or want.
However, I am happy to review and merge pull requests for features that developers want in PySHACL.
from pyshacl.
The schema.org shacl file used to work fine with PySHACL. That was actually one of the SHACL files I used for testing PySHACL during development.
There must've been a recent update that added the use of SPARQLFunction
. As far as I'm aware, the features from the SHACL Advanced Spec are not yet finalized, they may change before becoming a standard, and not considered stable for use in production validation systems, but that might be incorrect.
You can bypass this error if you turn off Advanced features in pyshacl
(don't pass in the -a
argument) this ignores all of the SHACL Advanced Spec features, and operates as if they don't exist in the SHACL file.
EDIT to add:
I didn't mean to imply that using pyshacl with the shema.org SHACL file is a niche thing. I know actually its the opposite. The vast majority of users of PySHACL are using it with shema.org shapes. In fact the main reason CSIRO sponsored the creation of PySHACL was to use it with shema.org shapes. What I meant was that the SPARQLFunction
from the SHACL Advanced Spec is a niche feature and I don't know anybody who uses it or needs it implemented in PySHACL.
from pyshacl.
Seems this might be a PySHACL bug.
I've checked the whole file, and the Schema.org SHACL file doesn't use SPARQLFunction
.
The SPARQLFunction
advanced feature is triggered by:
- A Shape that is of type
sh:SPARQLFunction
or - A shape with
sh:parameter
or - A shape with
sh:returnType
There are none of those in the Schema.org SHACL file. I'll have to dig a bit further to find out whats going on.
from pyshacl.
@James-Hudson3010
I cannot reproduce this bug. I've loaded the schema.ttl
file from Schema.org into PySHACL (with advanced mode turned on) and used it to validate several datafiles, and it works normally. It does not trigger the SPARQLFunction is not yet supported
error because sh:SPARQLFunction
is not used in that file.
from pyshacl.
Update:
I found it. SPARQLFunction
is used in http://datashapes.org/dash.ttl that is imported by schema.ttl
.
I had imports turned off, that's why I didn't see the error.
If you turn off imports, the SHACL file will not pull in dash.ttl
, so it will not throw this error.
Side note: Dash is another extension to SHACL, which is above and beyond the SHACL Advanced Spec, there a things like dash:Scripts and dash:Actions which can execute Javascript code on the dataset, and looks like there are a couple of helper functions which are Shapes that use SPARQLFunction
to execute SPARQL on the dataset.
I'm thinking about what will be the best way forward here. Blocking the import of dash.ttl
is one way, but is probably too heavy handed. Perhaps for now simply ignoring any shapes from the <http://datashapes.org/dash>
ontology might work, at least until PySHACL gets enough advanced features in order to take advantage of DASH.
from pyshacl.
I will check it out when I get the chance. Thank you.
from pyshacl.
Confirmed. Works for me now.
from pyshacl.
Related Issues (20)
- [Discussion] Pinned vs loose requirements, application vs library use cases HOT 5
- SPARQL ASK rule incorrectly passing HOT 7
- Can the prettytable dependency be upgraded to major version 3? HOT 1
- Generating SHACL-SPARQL shapes in RDFLib HOT 2
- Shacl does not seem to work on rdflib.Dataset() HOT 1
- Unable to see the validation result in pyshacl HOT 2
- How to ensure subject is not a sh:BlankNode when validating a owl:Class in an ontology? HOT 4
- owl:imports for data graph is hardcoded to false HOT 2
- pySHACL uses deprecated API `pkg_resources` HOT 4
- Trouble with qualified value shape HOT 6
- Failed to catch violations with properties that are not defined HOT 8
- Is a shape (whether node or property) restricted to one instance of sh:not? HOT 5
- Multiple sh:nots causing strange validation results HOT 2
- Multiple sh:xones on one sh:NodeShape grouping member shapes causing unexpected validation results
- `sh:entailment` and `pyshacl --advanced` HOT 1
- `sh:severity` on shapes linked by `sh:node` HOT 2
- `_evaluation_path` length is not configurable HOT 3
- [Discussion] Higher performance "remote" validation
- Difference between PySHACL and TopBraid SHACL API HOT 1
- Message: Node ex:**** does not contain a value in the set: ['Literal("true" = True, datatype=xsd:boolean)'] HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyshacl.