Git Product home page Git Product logo

Comments (4)

pchampin avatar pchampin commented on September 26, 2024 1

I think what you meant was

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

<ex:subject> <ex:values> _:li  {| <ex:asOf> "yesterday"  [}.
_:li rdf:first 1; rdf_rest (2 3).

or, more simply:

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

<ex:subject> <ex:values> (1 2 3) {| <ex:asOf> "yesterday" |}.

from json-ld-star.

gkellogg avatar gkellogg commented on September 26, 2024

I spent some time on this, and I don't think it's feasible without major updates to algorithms. Expansion and Compaction are easy enough, but Flattening, which is required for ToRDF and Framing, would need to pre-allocated a blank node as part of a list object so that it could be used to create an embedded node/triple.

Looking at the above example, you'd need to replace the @annotation with a new embedded node, which would require property referencing the head of the list (or rdf:nil), which doesn't exist. Hypothetically, it might look something like the following:

{
  "@default": {
    "ex:subject": {
      "ex:values": [{
        "@id": "_:list",
        "@list": [{"@value": 1}, {"@value": 2}, {"@value": 3}]
      }]
    },
    "{\"@id\":\"ex:subject\":\,"ex:values\":[{\"@id":\"_:list\"}]}":
      "ex:asOf": [{"ex:asOf": [{"@value": "yesterday"}]}]
    }
  }
}

But, list objects can't have @id, and in any case, the ToRDF algorithm has a lot of specialized code for lists.

Extracting the first element of the list (if any) and using rdf:first/rdf:rest is possible, but nowhere else does JSON-LD do anything special with these properties.

It seems like a lot of work for a marginal use case.

from json-ld-star.

gkellogg avatar gkellogg commented on September 26, 2024

Some work done on tests is preserved on the https://github.com/json-ld/json-ld-star/tree/list-annotations branch.

from json-ld-star.

pchampin avatar pchampin commented on September 26, 2024

Agreed, that's a lot of complication for a marginal use case... Let's drop it.

from json-ld-star.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.