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

List representation in RDF/JS #172

Open
gsvarovsky opened this issue Sep 4, 2023 · 1 comment
Open

List representation in RDF/JS #172

gsvarovsky opened this issue Sep 4, 2023 · 1 comment

Comments

@gsvarovsky
Copy link
Member

Lists in m-ld, using the @list JSON-LD keyword, do not transform to RDF Collections. They are more like RDF Containers (but still, not quite πŸ™‚). Plain RDF Collections don't converge nicely with concurrent edits – more about this in our Semantics poster. If you want to use lists we'll have to consider what to do here.

I read the semantics poster.
I can adapt the system to also support the structure m-ld is using. Another idea could be to abstract lists away. Do I see it correct that I could propagate list changes in m-ld specific format, but keep them in my own dataset as a rdf list?

Originally posted by @danielbeeke in m-ld/m-ld-spec#117 (reply in thread)

@gsvarovsky
Copy link
Member Author

Do I see it correct that I could propagate list changes in m-ld specific format, but keep them in my own dataset as a rdf list?

It would work quite well for m-ld to represent Lists as RDF Containers (I think!).

So, this JSON-LD:

{
  "@id": "ex.shopping",
  "@list": ["bread", "milk"]
}

would look like this:

<ex:shopping>
    a      rdf:Seq, mld:List ;
    rdf:_1 "bread" ;
    rdf:_2 "milk" .

The use of the m-ld vocabulary type would cause m-ld to maintain the List's coherence. So, for example INSERT <ex:shopping> rdf:_2 "cheese" would give:

<ex:shopping>
    a      rdf:Seq, mld:List ;
    rdf:_1 "bread" ;
    rdf:_2 "cheese";
    rdf:_3 "milk" .

(Note that milk has been re-indexed.)

Similarly, deleting items and concurrent edits also always maintain the list to be a continuous sequence, with one item per position.

  • βœ… It's still standard RDF
  • βœ… It maps closely to the JSON-LD (except with one-based indexing!) and to the internal representation
  • ❌ It's not an RDF Collection

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Future
Development

No branches or pull requests

1 participant