Comments (4)
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.
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.
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.
Agreed, that's a lot of complication for a marginal use case... Let's drop it.
from json-ld-star.
Related Issues (15)
- Broken link: https://github.com/json-ld/json-ld-bp/
- RDF to JSON should use @annotation, where possible HOT 5
- Make `rdfstar` an multiple-choice option rather than a flag HOT 7
- Expansion Algorithm: step 13.4.14
- Using `@annotation` on a `@type` HOT 15
- allow `"@annotation": "<IRI>"` in term definition HOT 3
- allow `"@type": "@triple"` or something similar? HOT 4
- W3C REC / JSON-LD 1.2/2.0 HOT 5
- are multiple triples forbidden in `@id`? HOT 1
- new container type leveraging RDF-star to encode order HOT 6
- rename "embedded node"
- Reverse properties in embedded nodes HOT 1
- Keeping quoted triples sharing subject within one node object
- Figure out restrictReferences on terms
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from json-ld-star.