-
Notifications
You must be signed in to change notification settings - Fork 154
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
Framing shouldn't introduce new blank node identifiers #293
Comments
Yeah, I've thought about having this option before -- we could have some extra state to keep track of those bnode IDs that were generated and remove them later if they aren't needed (based on the frame structure). |
Perhaps another cleanup step at the end of framing (perhaps at the end of compaction) that would remove blank node identifiers as values of |
We actually need this for a project now, and were working around it by filtering them out after framing if they were only used once. Unfortunately we implemented the work-around before we noticed this issue. |
Interesting. David could you expand a little on why you needed to do that?On Jan 9, 2017 20:31, David Booth <notifications@github.com> wrote:We actually need this for a project now, and were working around it by filtering them out after framing if they were only used once. Unfortunately we implemented the work-around before we noticed this issue.
—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or mute the thread.
|
We are doing round-trip testing, in which we translate from one RDF data model to another, and then back again to verify that no information was lost. The original data is in JSON-LD. We use framing to put it back into the original JSON-LD format (other than property ordering), so that we can simply do a JSON-diff on the result to detect any deviations from the original. The workaround makes a pass through the JSON-LD counting blank node references, and then comes back and deletes any that appear only once. |
As @dbooth-boston notes, algorithmically removing unnecessary blank nodes is easy enough. We already have a pass where we transform It should be controlled by an API option (pruneBlankNodeIdentifiers). I'd default it to |
Is there a plan on the horizon for implementing this feature? If it would be helpful, we could potentially contribute a PR for it. But if you were planning to implement it soon anyway, that is probably easier, since you obviously know your code base far better than we do. What do you think @gkellogg ? |
@dbooth-boston Sorry for the delay, working on the feature now. |
Hi Gregg,
Thanks for addressing this! We wanted to try it out, but we were
unable to find the actual code that implements it. It does not seem to
be appear in the commit that you cited, though we do see the option and
the documentation. Where is the code for it?
thanks,
David Booth
…On 04/16/2017 09:06 PM, Gregg Kellogg wrote:
Closed #293 <#293> via
90b53c5
<90b53c5>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#293 (comment)>, or
mute the thread
<https://github.com/notifications/unsubscribe-auth/AE4smrLv9GTByLcwxNiSZC6aMerszqr7ks5rwrr_gaJpZM4A4zZC>.
|
I've implemented this in the Ruby implementation in this commit: ruby-rdf/json-ld@b76c51f
Gregg Kellogg
…Sent from my iPad
On May 10, 2017, at 2:50 AM, David Booth ***@***.***> wrote:
Hi Gregg,
Thanks for addressing this! We wanted to try it out, but we were unable to find the actual code that implements it. It does not seem to be appear in the commit that you cited, though we do see the option and the documentation. Where is the code for it?
thanks,
David Booth
> On 04/16/2017 09:06 PM, Gregg Kellogg wrote:
> Closed #293 <#293> via
> 90b53c5
> <90b53c5>.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#293 (comment)>, or
> mute the thread
> <https://github.com/notifications/unsubscribe-auth/AE4smrLv9GTByLcwxNiSZC6aMerszqr7ks5rwrr_gaJpZM4A4zZC>.
>
|
Any plans to add this to the JavaScript implementation? Or would you
recommend that we try to do it an submit a pull request?
thanks,
David Booth
…On 05/10/2017 10:04 AM, Gregg Kellogg wrote:
I've implemented this in the Ruby implementation in this
commit: ruby-rdf/json-ld@b76c51f
Gregg Kellogg
Sent from my iPad
On May 10, 2017, at 2:50 AM, David Booth ***@***.***
***@***.***>> wrote:
> Hi Gregg,
>
> Thanks for addressing this! We wanted to try it out, but we were
> unable to find the actual code that implements it. It does not seem
> to be appear in the commit that you cited, though we do see the option
> and the documentation. Where is the code for it?
>
> thanks,
> David Booth
>
> On 04/16/2017 09:06 PM, Gregg Kellogg wrote:
>> Closed #293 <#293> via
>> 90b53c5
>> <90b53c5>.
>>
>> —
>> You are receiving this because you were mentioned.
>> Reply to this email directly, view it on GitHub
>> <#293 (comment)>, or
>> mute the thread
>> <https://github.com/notifications/unsubscribe-auth/AE4smrLv9GTByLcwxNiSZC6aMerszqr7ks5rwrr_gaJpZM4A4zZC>.
>>
|
@dbooth-boston, we will add it eventually to jsonld.js, but that usually means me doing the implementation and I'm swamped with other work for while. PRs are always welcome of course if you need to get the feature in sooner. |
Raised by Robert Sanderson:
[...] not naming blank nodes would also be another nice output option, rather than generating explicit bnode names [when framing a document].
The text was updated successfully, but these errors were encountered: