Skip to content

Upgrade to rdflib 0.15.0, update PATCH tests - #503

Merged
dmitrizagidulin merged 9 commits into
masterfrom
rdflib-15
Jun 2, 2017
Merged

Upgrade to rdflib 0.15.0, update PATCH tests#503
dmitrizagidulin merged 9 commits into
masterfrom
rdflib-15

Conversation

@dmitrizagidulin

@dmitrizagidulin dmitrizagidulin commented May 17, 2017

Copy link
Copy Markdown
Contributor

Addresses issue #491.
Fixes PATCH- and Glob-related failed tests when upgrading to rdflib 0.15.0

@dmitrizagidulin

Copy link
Copy Markdown
Contributor Author

cc @timbl / @dan-f for review.

@dan-f dan-f left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I fail to see how this "fixes Glob-related failed tests". I found several "glob-related tests", but none of them changed in this PR.

The first glob-related tests are actually skipped. I tested, on master, un-skipping that describe block, and all of the glob tests failed. This is before the rdflib upgrade.

The second "glob test" doesn't test globbing. It simply tests for a 200 response code and content-type text/turtle.

Comment thread lib/handlers/get.js Outdated
undefined,
globGraph,
null,
filename,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So filename here gets bound to something like 'example.com/thing/*', which isn't an actual URI.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

An asterisk is a valid URI character. But whether that's the preferred semantics, as far as the base uri when using file patterns, is a tough call. We'll need to discuss it with @timbl etc.

@dan-f dan-f May 18, 2017

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

My point was not regarding the asterisk. It was regarding the lack of a URI scheme.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ohh I see. Thanks! will fix

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed the base serialization uri to be the request uri.

Comment thread lib/handlers/get.js
globGraph,
null,
filename,
'text/turtle')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What if the client doesn't want text/turtle? I hoped there's content negotiation, based on our spec.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

From what I understand, glob functionality is only spec'd/implemented for Turtle.

@dan-f dan-f May 18, 2017

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

From what I understand, the notion of "globbing all the graphs in an LDP container into a single graph" is agnostic to any particular serialization format.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We can open an issue to add support for multiple content types for globbing, for solid-server. This PR is just intended to upgrade the server to the latest rdflib version.

@dmitrizagidulin dmitrizagidulin May 19, 2017

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I opened issue #504 to add support for content negotiation with globbing.

Comment thread test/patch-2.js Outdated
'@prefix profile: <http://ogp.me/ns/profile#>.\n' +
'\n' +
' <#> profile:first_name "Timothy"; a schema:Person .\n')
'@prefix : </prefixSparql.ttl#>.\n@prefix schema: <http://schema.org/>.\n@prefix pro: <http://ogp.me/ns/profile#>.\n\n: a schema:Person; pro:first_name "Timothy".\n\n')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A bit confused about this change given the one above. Let's be consistent with formatting of data. I think the previous change is much more readable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No prob, will change it to match.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Changed the expected value formatting to be multi-line. Thanks!

@dmitrizagidulin

Copy link
Copy Markdown
Contributor Author

I fail to see how this "fixes Glob-related failed tests". I found several "glob-related tests", but none of them changed in this PR.

I just meant - this PR passes the failing tests that are introduced by upgrading to latest rdflib.

The first glob-related tests are actually skipped. I tested, on master, un-skipping that describe block, and all of the glob tests failed. This is before the rdflib upgrade.

Yeah, that's weird, I'm not sure what the story was with those. I added an issue, #505, to un-skip and implement those tests.

The second "glob test" doesn't test globbing. It simply tests for a 200 response code and content-type text/turtle.

Yeah, also odd. I expanded that test to actually check for result contents.

@dmitrizagidulin
dmitrizagidulin force-pushed the rdflib-15 branch 2 times, most recently from 6cd583b to ab255b3 Compare May 19, 2017 15:26
Comment thread lib/handlers/get.js
undefined,
globGraph,
null,
requestUri,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This change is still untested.

@melvincarvalho

Copy link
Copy Markdown
Contributor

A gentle bump on this.

Hope it's OK, that I added the blocker label, as this fix will enable me to log in to node solid server, and therefore, work more effectively.

@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix ex: <http://example.org/stuff/1.0/> .

</sampleContainer/example*> a :glob.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added to address @dan-f's comment; tests the requestUri being used as a serialization base for globs. (per @timbl's instructions)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Uh... I would expect this triple to be dynamically added by the glob code, not statically added to the sampleContainer/example1.ttl graph.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This isn't an official designation or anything, just a triple @timbl recommended to test the serialization base in the output.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I find it a really confusing example. Why not just add <#a> dc:title "foo" . to example1.ttl and then expect to see <example1.ttl#a> dc:title "foo" . in the glob?

I don't want to hold this up any longer

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The example tests the serialization base being the glob request uri. The one you mention, <#a> dc:title "foo" . tests the parsing base (relative to example1.ttl). I'll add this line also.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Huh. Sounds like I am missing some context from your discussion. I think you should merge if you and @timbl are happy with the test.

@deiu deiu Jun 1, 2017

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

FYI, this is not how you test glob. </sampleContainer/example*> a :glob. being in a document makes no sense to me. Globbing means doing a GET on /sampleContainer/example* and returning the contents from multiple documents that start with the name example.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@deiu would something like </sampleContainer/example*> :test "testing serialization base" . make more sense, instead?

I don't have a stake in this argument; was just adding the statement at @timbl's suggestion.

@deiu deiu Jun 1, 2017

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

First, you don't have to keep this PR open on my account. Please merge if you think it's the right thing to do. I'm only pointing out that having a triple with the subject /example* in that document makes absolutely no sense. The * character must be removed by the server before it starts to glob resources together, it should never be treated as a regular resource (which is what the test currently does). Its presence there also shows that the test was written by someone doesn't really understand how globbing works.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@deiu I've replaced the <example*> a :glob statement with the example you & @dan-f suggested.

@dmitrizagidulin
dmitrizagidulin merged commit cba687c into master Jun 2, 2017
@RubenVerborgh RubenVerborgh added this to the 4.0.0 milestone Aug 10, 2017
@dmitrizagidulin
dmitrizagidulin deleted the rdflib-15 branch June 7, 2018 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants