Skip to content

Conversation

@dmitrizagidulin
Copy link
Contributor

Fixes issue #476.

@dmitrizagidulin
Copy link
ContributorAuthor

cc @csarven for testing -- let me know if this passes the LDN test.

@csarven
Copy link
Member

The URIs in the output looks good to me.

@csarven
Copy link
Member

Passes LDN tests as well! Note that it only tests JSON-LD.

However, I'm noticing that if a resource with JSON-LD uses "@id": "" (as the subject of triples), and then 'Accept: text/turtle' is requested on that resource, the Turtle serialization doesn't return that triple. If the "@id": "http://example.net/note#foo", it serializes to Turtle ok.

@dmitrizagidulin
Copy link
ContributorAuthor

@csarven - can you open an issue for that (the turtle serialization thing you mention above), with some more details (an example file so I can reproduce it, etc)?

@dmitrizagidulin
Copy link
ContributorAuthor

Is "@id": "" a valid JSON-LD statement?

@csarven
Copy link
Member

Created issue #497

@csarven
Copy link
Member

Yes, "@id": "" is valid JSON-LD. It is equivalent to <> in Turtle.

Copy link
Contributor

@RubenVerborghRubenVerborgh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionally correct; maybe the names can be clarified.

lib/utils.js Outdated
*/
function uriBase (req){
return uriAbs(req) + (req.baseUrl || '')
return uriAbs(req) + url.resolve(req.baseUrl, req.path)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took me some figuring out, but it seems correct indeed.

I just wonder whether uriBase is the right name; something like fullUri seems to better convey the meaning.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, uriAbs doesn't seem intuitive; I actually think this one should be called uriBase.

@RubenVerborgh
Copy link
Contributor

Had a go at the renaming in 8aea09e.

@dmitrizagidulin
Copy link
ContributorAuthor

@RubenVerborgh nice! :) 👍

@dmitrizagidulindmitrizagidulin merged commit 132743a into masterAug 18, 2017
@dmitrizagidulindmitrizagidulin deleted the fix-serialize-base-path branch August 18, 2017 20:43
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@dmitrizagidulin@csarven@RubenVerborgh