Comments (18)
Hi Nicola,
Thanks for the feedback, credits go mainly to @bergos :)
I don't think path resolving is currently implemented, question is is this defined behavior in RDF? And this question could probably be answered by @retog
from rdf-ext.
How did you parse the graph? For example the JSON-LD parser would resolve the relative path in the expand step. But like @ktk mentioned, first we need to know if there is a definition? Maybe @RubenVerborgh has an answer to this question.
from rdf-ext.
The conclusive answer is in the RDF 1.1 specification:
Relative IRIs must be resolved against a base IRI to make them absolute.
from rdf-ext.
And the fact that this doesn't happen seems to be an N3.js bug: rdfjs/N3.js#51
from rdf-ext.
@nicola btw. have you seen Clownface for graph traversing? Here an example how you would fetch the preferences file:
var cf = rdf.cf.Store(new rdf.promise.Store(new rdf.LdpStore()));
cf.node('https://nicola.databox.me/profile/card#me')
.then(function (cf) {
console.log(cf.out('http://www.w3.org/ns/pim/space#preferencesFile').literal().shift());
});
from rdf-ext.
Of course I have seen it, it is very cool (I think that should be decoupled from this library as well!!).
I was going to build a similar system and I found it - I will let you know what I think after using it for a bit
from rdf-ext.
@RubenVerborgh it doesn't exactly not happen, the IRI Ref is not kept relative which would be against the specs (except the LDP spec, but that's another story). The thing is that the IRI is not made absolute the right way (i.e. according to the IRI RFC 3987 and RFC 3986): instead of https://nicola.databox.me/profile/../Preferences/prefs it should be https://nicola.databox.me/Preferences/prefs.
from rdf-ext.
I hope that is the case, or it would be a nightmare for me to do that simple operation
from rdf-ext.
@retog Yes, that's what I mean: the resolving happens by just sticking both parts together, whereas (only) leading sequences of ../
in the relative URL should be correctly removed when resolving. It's a bug in N3.js, which I will fix soon.
from rdf-ext.
I just got a funny: https://nicola.databox.me/profile/../Preferences/../
from rdf-ext.
Fixed in rdfjs/N3.js@1a0dc71 without performance impact on other types of IRIs. Will leave people some time to verify the correctness of the solution and then do a 0.4.4 release that includes the fix.
from rdf-ext.
@retog I actually found the RDF spec to be ambiguous about IRI resolution: https://lists.w3.org/Archives/Public/public-rdf-comments/2015Aug/0000.html. Until an answer is found, I don't feel comfortable landing a release.
from rdf-ext.
@RubenVerborgh if I get that correctly the discussion is pretty much set right? Any ETA for new release?
from rdf-ext.
Not set, no, still actively discussing: https://lists.w3.org/Archives/Public/public-rdf-comments/2015Sep/
ETA: could still be a week.
from rdf-ext.
Ah didn't notice that I only saw postings in August in the web interface of the list, thanks for the link.
from rdf-ext.
@RubenVerborgh iiuc the spec ambiguity only applies when the Turtle document contains non-normalized non-relative IRIs (i.e. the document contains https://nicola.databox.me/profile/../Preferences/prefs as base IRI or as a IRI for a resource). I seems however clear that when a relative IRI with trailing [./|../]* and no other ./ or ../ has to be resolved against a normal based IRI this has to result in a normal resource IRI. So in the example in this issue the resource name should be https://nicola.databox.me/Preferences/prefs rather than https://nicola.databox.me/profile/../Preferences/prefs under any plausible interpretation of the spec.
from rdf-ext.
@retog Yes indeed, there's no unclarity about this specific case; consequently, the fix for this case was already made 2 weeks ago. However, I'm still waiting for a confirmation for other cases, so the next release of N3.js does IRI resolution correct in all cases, not just this one.
from rdf-ext.
Released N3.js 0.4.4 with correct implementation of RFC 3986, which includes the cases in this thread.
from rdf-ext.
Related Issues (20)
- Contains function? HOT 1
- PrefixMap.addAll should return this HOT 12
- Set withCredentials to true in utils.defaultRequest HOT 2
- createLiteral or createTriple cannot handle non-string values HOT 7
- Use request instead HOT 5
- Use inherits instead of util.inherit HOT 2
- Auto-resolve CURIEs on NamedNode creation HOT 8
- Allow to create blank nodes with custom label HOT 8
- Support priorities in Parsers class HOT 1
- Is it possible to serialize a graph to RDF/XML? HOT 4
- List RDF/XML serializer in documentation HOT 2
- Abstract serializer link is broken in README HOT 1
- is there a non-browserify distribution available HOT 2
- Support RDFJS DataFactory interface HOT 3
- Allow to set Authorization header HOT 2
- UglifyJS chokes on ES2015 code HOT 4
- Failing to parse RDF/XML with 'rdfxml-streaming-parser''? HOT 10
- Regression in 1.3.4 HOT 2
- Using versions 2.0.0 and 2.0.1 in typescript env throws error HOT 1
- Reduce function? HOT 1
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 rdf-ext.