Comments (7)
Escaping is tricky, especially since we use the same escape character in reference formulations as Turtle. If we write in something else then Turtle, we only need to escape once, other 2x.
In non-Turtle you can write \{
and escape it
In Turtle you must write \\{
to escape it.
However in 2 you might be confused if the \\
is escaping the {
or means \
as token. Spoiler alert: you need to do \\\
in Turtle for \
in a reference formulation.
from rml-core.
SHACL can do regex, once the listed regex is tested and test cases are provided with valid and invalid templates, we can add it.
from rml-core.
Tasks required:
- Test the regex provided and ensure that the constraint is correct
- Define test-cases with valid templates (I think this is by default now and it's not required)
- Define a few test-cases with invalid templates.
@DylanVanAssche could you take care of this?
from rml-core.
Define a few test-cases with invalid templates.
AFAIK, these are the 'rules':
A string template is a format string that can be used to build strings from multiple components. It can apply [reference expressions](https://kg-construct.github.io/rml-core/spec/docs/#dfn-reference-expression) by enclosing them in curly braces ({ and }). The following syntax rules apply to valid [string templates](https://kg-construct.github.io/rml-core/spec/docs/#dfn-string-template):
1. Pairs of unescaped curly braces MUST enclose valid [reference expressions](https://kg-construct.github.io/rml-core/spec/docs/#dfn-reference-expression).
2. Curly braces that do not enclose [reference expressions](https://kg-construct.github.io/rml-core/spec/docs/#dfn-reference-expression) MUST be escaped by a backslash character (\). This also applies to curly braces within [reference expressions](https://kg-construct.github.io/rml-core/spec/docs/#dfn-reference-expression).
3.Backslash characters (\) MUST be escaped by preceding them with another backslash character, yielding (\\). This also applies to backslashes within [reference expressions](https://kg-construct.github.io/rml-core/spec/docs/#dfn-reference-expression).
4.There SHOULD be at least one pair of unescaped curly braces.
from spec.
Anything missing?
If not, we need to have 4 invalid test cases, one for each rule.
from rml-core.
I don't think so, please proceed :-)
from rml-core.
Is escaping really that tricky? You just need to load the file into a graph and indicate the format, no? Only then do we need to test the regex. That said, implementers can rely on ill-founded assumptions, so the test cases should provide redundant ones for RDF/XML, N-Quads, and even JSON-LD.
from rml-core.
Is escaping really that tricky? You just need to load the file into a graph and indicate the format, no?
If you use tools, they take care of that. It is mostly tricky if you write mappings manually. This is purely a developer experience thing. Since Turtle and the template-syntax use the same escape character /
it becomes tricky when writing by hand.
from rml-core.
Related Issues (20)
- Issues with MySQL test cases HOT 10
- RFC: RMLTC0002c-JSON & RMLTC0002c-XML (bis) HOT 2
- Error in spec about referencing attributes when processing XML HOT 1
- Issues with XML test cases HOT 8
- Missing test cases for multi-valued reference maps HOT 4
- Inconsistencies, errors, ... in SHACL shapes
- OM, SM, and GM may have no reference, template, or constant HOT 6
- Implementation notes HOT 18
- Should DatatypeMap be defined as a TermMap? HOT 3
- Result of expressions should be an array/list instead of set
- Use RFC 9535 JSONPath compliant query expressions in spec and test cases
- Define ill-formed joins in the spec HOT 4
- capture a piece of JSON/XML as a literal HOT 2
- Define Logical Source in RML-Core instead of RML-IO HOT 1
- Miss-Alignment between the shapes in https://kg-construct.github.io/rml-core/ontology/rml-core-bc.ttl and R2RML specification HOT 4
- There is no notion of order in RDF mappings, and this has implications for the RDF output HOT 2
- How to construct graph object HOT 2
- Replace `sh:name` and `sh:description` in SHACL shapes HOT 2
- Issue in test case 10b-JSON HOT 3
- Enhance validation and generation error description in the spec HOT 8
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 rml-core.