Re: a simplified Turtle-like profile for JSON-LD

> On May 12, 2024, at 3:36 PM, Melvin Carvalho <melvincarvalho@gmail.com> wrote:
> 
> Definitely allow fragids and relative URIs consistent with JSON-LD including "".
> 
> Bnodes, I've not really thought about. I'm hopeful that it might not be needed, or could fall back to some standard techiques.
> 
> Definitely graphs and cycles as well as trees. 

what will be the semantics for an "@id" that occurs in more than one place, especially in the "there's more to say about the target" case? expanding on the example in https://linkedobjects.org/Linked-JSON

> {
>   "@id": "https://example.com/resource-1",
>   "name": "Alice",
>   "friend": {
>     "@id": "https://example.com/resource-2",
>     "name": "Bob",
>     "friend": {
>       "@id": "https://example.com/resource-1"
>     }
>   }
> }

here i'm saying Alice (https://example.com/resource-1) is also Bob's friend, in addition to having Bob as a friend. notice i'm not saying '"name": "Alice"' in the friend link inside Bob. is the intent that the reader would parse this into a proper internal graph form, and merge any members in Objects with the same @id (that is, there'd be one Object or node or whatever named https://example.com/resource-1 in the internal representation)? since JSON Object keys are unordered, you can't say "the first time an @id is mentioned you expand it" because you can't be sure which time might be the first time. what should happen if another instance of the Object/URI elsewhere in the document has something different to say? what should happen if there's conflicting information (like elsewhere i were to say resource-1's name was "Eve" — should those be merged into an array of values, or one wins, or it's a parse error)?

i think the goal of "a convention for indicating a URI in JSON using the JSON-LD keyword '@id'" is excellent (i already do that in my own work even when not doing RDF). however, once you get to naming nodes and talking about graphs and cycles and stuff, i think all the different possible arrangements start to push you toward RDF and a graph (or triples) data model, and you need to bring in a lot more of the rules and semantics from JSON-LD even if the only keyword you're adopting is "@id".

-mike

Received on Sunday, 12 May 2024 23:26:03 UTC