Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Describe lists containing lists, as motivated by GeoJSON. #41

Merged
merged 4 commits into from
Aug 11, 2018

Conversation

gkellogg
Copy link
Member

@gkellogg gkellogg commented Aug 5, 2018

Fixes #36.

This is implemented in w3c/json-ld-api#16.


Preview | Diff

@iherman
Copy link
Member

iherman commented Aug 5, 2018

@gkellogg,

I do not have a real issue with the changes, so we can merge it; my comments are purely of an editorial nature and reflect a matter of taste... Take them as you wish, salt 'n pepper them at taste...

  • I would separate the parts on sets and lists in two subsections. The two notions have a different feel and setting, and it would increase readability
  • The session after the table reprsenting lists in RDF you have a section that begins with "Consequently...", which is a bit out of place in this document, we usually do not analyze other serializations. I would just give the example in Turtle, and leave that (and, also, the "unwieldy" comment before the table) out. In any case, as I already raised in Explanation of examples #26, I would think we will have to rethink how we represent all our examples anyway.
  • You say "In JSON-LD 1.1, we can express this using recursive lists, by simply adding the appropriate context definion". This may be understood as this being the only way of doing so, which is not true. One can use repeated @list keywords for each series of coordinates, it is just unreadable...

Copy link
Member

@iherman iherman left a comment

Choose a reason for hiding this comment

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

@gkellogg
Copy link
Member Author

gkellogg commented Aug 5, 2018

I would separate the parts on sets and lists in two subsections. The two notions have a different feel and setting, and it would increase readability

They are both about arrays and ordering, which is why they were together. We do need to do a comprehensive reorganization, but I'd rather not do that on a piecemeal basis.

The session after the table reprsenting lists in RDF you have a section that begins with "Consequently...", which is a bit out of place in this document, we usually do not analyze other serializations. I would just give the example in Turtle, and leave that (and, also, the "unwieldy" comment before the table) out.

Noted.

In any case, as I already raised in #26, I would think we will have to rethink how we represent all our examples anyway.

Indeed, but this is a somewhat daunting task, for which I could use some help. In particular, we probably need to use something like jsonld-vis to simplify creating such graphs, although this may prove to be a problem for non-HTML use.

@iherman
Copy link
Member

iherman commented Aug 6, 2018

Hey @gkellogg

They are both about arrays and ordering, which is why they were together. We do need to do a comprehensive reorganization, but I'd rather not do that on a piecemeal basis.

I was not clear, sorry about that. I meant deeper subsections within this subsection. But I agree that this can wait, subject to a reorganization

Indeed, but this is a somewhat daunting task, for which I could use some help. In particular, we probably need to use something like jsonld-vis to simplify creating such graphs, although this may prove to be a problem for non-HTML use.

It is complicated indeed. The table/expanded/TriG/n-quads versions may not be that bad just lot of writing; if the graphs prove to be too much work, we can drop that one.

(B.t.w., for some reasons, example 57 does not appear in the preview. I presume it will be there for the merged version.)

@azaroth42
Copy link
Contributor

+1 to reorganization, and +1 to not doing it as part of this PR :)
Also ... +1 to the PR.

@azaroth42 azaroth42 self-requested a review August 7, 2018 16:52
@gkellogg
Copy link
Member Author

gkellogg commented Aug 7, 2018

I'd like to handle this PR and w3c/json-ld-api#16, which ideally could use an implementation, but should at least have a review.

@simonstey
Copy link

I already pinged Axel and I'll give it a read tmrw!

index.html Outdated
</pre>

<p class="changed">In JSON-LD 1.1, lists of lists, where the value of
a <a>list object</a>, may itself be a <a>list object</a> recusively, are

Choose a reason for hiding this comment

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

s/recusively// (I don't think we need to say that)

index.html Outdated
a <a>list object</a>, may itself be a <a>list object</a> recusively, are
fully supported. For example, in <em>GeoJSON</em> (see [[RFC7946]]),
<em>coordinates</em> are an ordered list of <em>positions</em>, which are
represented as an array of two or more numbers. For example:</p>

Choose a reason for hiding this comment

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

s/numbers. For example:/numbers:/

index.html Outdated
}
</pre>

<p class="changed">For this example, it's important that the values

Choose a reason for hiding this comment

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

  • For this example,

    only for this example or all uses of coordinates?

  • s/the values/values/

index.html Outdated
</pre>

<p class="changed">For this example, it's important that the values
expressed within coordinates maintain their order, which requires the use of

Choose a reason for hiding this comment

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

s/coordinates/coordinates/ ?

Copy link

@simonstey simonstey left a comment

Choose a reason for hiding this comment

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

added minor comments inline

@BigBlueHat
Copy link
Member

@sgillies as the primary author of GeoJSON-LD your thoughts on this would be most appreciated!

[-10.0, -10.0],
[10.0, -10.0],
[10.0, 10.0],
[-10.0, -10.0]

Choose a reason for hiding this comment

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

I feel that GeoJSON examples can be made less confusing with respect to longitude, latitude ordering by using real-world coordinates like [-105.615115, 40.255014] (latitude: 40.255 degrees N, longitude: 105.615 degrees W).

Copy link
Member Author

Choose a reason for hiding this comment

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

Note that the lists of lists feature does not preclude #34, although it becomes less important, and it does add significantly more complexity to the processing model.

"@vocab": "https://purl.org/geojson/vocab#",
"type": "@type",
"bbox": {"@container": "@list"},
"coordinates": {"@container": "@list"}

Choose a reason for hiding this comment

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

In geojson/geojson-ld#34 we discussed an @ndarray, but @list looks just as good, or better in that it's easier to explain and understand.

{"@list": [{"@value": -10.0}, {"@value": -10.0}]},
{"@list": [{"@value": 10.0}, {"@value": -10.0}]},
{"@list": [{"@value": 10.0}, {"@value": 10.0}]},
{"@list": [{"@value": -10.0}, {"@value": -10.0}]}

Choose a reason for hiding this comment

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

This is fine. Tagential question: is there a way to indicate to JSON-LD users that the first element of these 2-tuples is longitude and the second is latitude?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not really. If the vocabulary were modeled in OWL, there may be some way to do this at that level, @iherman may know better.

Copy link
Member

Choose a reason for hiding this comment

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

To be honest, even in OWL I don't see a way to do that.

Copy link
Member

Choose a reason for hiding this comment

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

@sgillies FWIW, we've got an issue to discuss/address that. See: #7 "support @values for describing multidimensional containers"

Copy link
Member

Choose a reason for hiding this comment

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

From a graph modeling perspective, the fact that the lat/long were originally presented in a list isn't important, is it? Only the "outer" list of coordinates has value to the graph (afaict).

Copy link
Contributor

Choose a reason for hiding this comment

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

What @gkellogg and @iherman said. In JSON-LD it will just be surface syntax of arrays. At the RDF level, it will be nested rdf:Lists with no further semantics. If more semantics are required, then a different structure would also be required.

@gkellogg gkellogg merged commit 40d18d5 into master Aug 11, 2018
@gkellogg gkellogg deleted the issue-36-lists-of-lists branch August 11, 2018 21:49
Sign up for free to 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.

None yet

6 participants