-
Notifications
You must be signed in to change notification settings - Fork 1
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
Use of vocabulary-scoped identifiers in @values
#77
Comments
The problem is that a plain string like ...
"@values": [{
"?id": { "@id": "http://www.example.com/foo" }
}]
... There are only a few contexts in which a plain string will be interpreted as an IRI:
In some cases you can also use a Let me know if this makes sense and fixes the issue for you. In the meantime let's leave the ticket open while we decide the best way to emphasise this in the documentation. |
Ah, of course. That works great. Okay, round 2: I'll need to also match the property name with Is there a facility for normalizing an object by applying the context that m-ld will be using? That would probably be easier to work with. |
Ah, that's awkward. Leakage of the
Hmm |
Ah, okay. I think what I was missing was the different meanings of What I'm working on here is a function await state.write({
"@insert": subjects,
"@delete": { "@id": "?id", "?property": "?value" },
"@where": {
"@graph": {
"@id": "?id",
"?property": "?value",
},
"@values": [
{},
...subjects.flatMap((subject) =>
Object.keys(subject)
.filter((key) => key != "@id")
.map((key) => ({
"?id": { "@id": subject["@id"] },
"?property": { "@id": `#${key}` },
})),
),
],
},
}); But I still need to translate from Edit: Actually, it looks like the single write isn't working as well as I thought it would, so I'm back to a read and then a write. But in any case, the relevant point stands. |
Option 3 replaces
with
The This actually offers a fix for the equivalent problem in JSON-LD. |
Somewhere along the way this query has lost its For casual observers, see #76 (comment) |
@values
@values
Suggested option #77 (comment) is now available on the edge:
|
Ah! I'm following now. Yep, I like that too!
Yes, sorry, I should have been clearer there: I'm specifically trying to avoid this |
I created another issue for this. In the meantime, hopefully the need for the |
This looks like a bug to me, but I also could easily be misunderstanding the intended semantics. I'm not sure how to characterize it, so by all means, please retitle this issue if you can put it more usefully. 😃
Given the following data:
I expected the query:
to return:
but instead it returns
[]
. (playground)A similar
@select
query also yields[]
. (playground)For what it's worth, an empty
@values
successfully returns all of the data. (playground)The use case here is that I'm trying to read all of the existing triples for properties that I'm about to write, so that I can
@delete
the old values when I@insert
the new values. I should be able to do the same thing with a bunch of reads and put them together, but that seems odd (but might be what I'll do for now, at least).The text was updated successfully, but these errors were encountered: