Skip to content
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

unmodified prov-json documents cannot be stored in mongoDB due to field name restrictions #134

Open
etorres opened this issue Jul 16, 2015 · 5 comments

Comments

@etorres
Copy link

etorres commented Jul 16, 2015

Field names in mongoDB cannot start with a dollar sign, making that prov-json documents cannot be stored without first being modified. This limitation is normally overcome by escaping the dollar sign (e.g using the Unicode full width equivalent).

It's very likely that similar limitations could be found in other document-oriented databases where field names usually have semantic meaning. I would be interested in having a general mechanism to make prov-json documents compatible with existing database systems.

Additional References:

@trungdong
Copy link
Contributor

Hi @etorres,

Thank you for bringing this to our attention. We'd love to support the escaping you suggested as an output option.

We're currently using the gson library for JSON serialization. Allow me sometime to investigate how gson can support this kind of escaping.

@tballast
Copy link

Has this been addressed at all in the last years? We are facing the same issue and would love to be able to use the default output directly in MongoDB.

@lucmoreau
Copy link
Owner

We are routinely using the more recent prov-jsonld serialisation with mongodb without problem.

@tballast
Copy link

@lucmoreau Thanks you for your response. I have tried it and it looks like it should work. Is there a way to control which keys are added to the output though?

For example:

...
  "@graph" : [ {
    "@type" : "prov:Agent",
    "@id" : "pfx:entity::CompanyName",
    "efg:resourceType" : [ {
      "@value" : "entity"
    } ],
    "prov:role" : [ ],
    "prov:value" : [ ],
    "prov:type" : [ "prov:Organization" ],
    "prov:label" : [ ],
    "prov:location" : [ ]
  }, {
...

I don't need all of the empty fields to be present, and I don't believe that they are required either.

@lucmoreau
Copy link
Owner

lucmoreau commented Jan 17, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants