How do VF proposed changes work with graphql
This refers to valueflows/valueflows!730 (merged), which is still in process. But the info related to my question is included below.
The question: What are the graphql implications of these changes? And are they for the better or for the worse?
Basically, I'm adding some inverse naming explicitly in the spec (which shouldn't make any difference really), but more to the point, changing the way the many-to-many relationships work from a relational model to a more rdf-friendly model. Starting with only the ones without properties, and removing the reciprocal
property from ProposedIntent.
Like this:
For all the inverses I've added, see the turtle file in the branch, look for inverseOf
.
In an ActivityPub exercise, which is part of explicitly defining VF extensions to AP, the json-ld example looks like this. It reminds me of graphql. (It doesn't support all of the VF structure, e.g. multiple primary and reciprocal intents. Also it "mixes up" the AP and VF properties.)
{
"@context": [
"https://www.w3.org/ns/activitystreams",
{
"om2": "http://www.ontology-of-units-of-measure.org/resource/om-2/",
"vf": "https://w3id.org/valueflows/",
"Proposal": "vf:Proposal",
"Intent": "vf:Intent",
"receiver": "vf:receiver",
"provider": "vf:provider",
"action": "vf:action",
"unitBased": "vf:unitBased",
"publishes": "vf:publishes",
"reciprocal": "vf:reciprocal",
"resourceConformsTo": "vf:resourceConformsTo",
"resourceQuantity": "vf:resourceQuantity",
"hasUnit": "om2:hasUnit",
"hasNumericalValue": "om2:hasNumericalValue"
}
],
"type": "Proposal",
"id": "https://market.example/proposals/ddde9d6f-6f3b-4770-a966-3a18ef006930",
"attributedTo": "https://market.example/users/alice",
"name": "Offering used bike",
"content": "Blue one-speed bike, 15 years old, some rust",
"published": "2023-06-18T19:22:03.918737Z",
"location": {
"type": "Place",
"longitude": -71.0,
"latitude": 25.0
},
"publishes": {
"type": "Intent",
"id": "https://market.example/proposals/ddde9d6f-6f3b-4770-a966-3a18ef006930#primary",
"action": "transfer",
"resourceConformsTo": "https://www.wikidata.org/wiki/Q11442",
"resourceQuantity": {
"hasUnit": "one",
"hasNumericalValue": "1"
},
"availableQuantity": {
"hasUnit": "one",
"hasNumericalValue": "1"
},
"provider": "https://market.example/users/alice"
},
"reciprocal": {
"type": "Intent",
"id": "https://market.example/proposals/ddde9d6f-6f3b-4770-a966-3a18ef006930#reciprocal",
"action": "transfer",
"resourceConformsTo": "https://www.wikidata.org/wiki/Q4917",
"resourceQuantity": {
"hasUnit": "one",
"hasNumericalValue": "30"
},
"receiver": "https://market.example/users/alice"
},
"unitBased": false,
"to": "https://www.w3.org/ns/activitystreams#Public"
}