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

odd CHEBI identifier #301

Closed
balhoff opened this issue Feb 8, 2020 · 14 comments
Closed

odd CHEBI identifier #301

balhoff opened this issue Feb 8, 2020 · 14 comments

Comments

@balhoff
Copy link
Contributor

balhoff commented Feb 8, 2020

Is this CHEBI identifier a mistake? (doesn't use standard CHEBI IRI structure)

skos:mappingRelation <https://w3id.org/biolink/vocab/CHEBI:23888>,

@mbrush
Copy link
Collaborator

mbrush commented Feb 11, 2020

This does look strange to me as well. Guessing @hsolbrig or @cmungall can provide an answer.

@deepakunni3
Copy link
Member

@hsolbrig It looks like while generating the TTL, it does not use CURIE prefix to IRI mapping provided via context.jsonld. Instead, it is using https://w3id.org/biolink/vocab/.

Although I don't see a pattern. Some CURIEs are expanded to their proper IRI while others are not.

@cmungall
Copy link
Collaborator

yeh this is odd... can you investigate further?

@hsolbrig hsolbrig self-assigned this Feb 13, 2020
@hsolbrig
Copy link
Member

The issue is a bug (feature) in the JSON-LD 1.0 specification, where prefix aliases had to end with "/" or "#" to be considered prefixes. See: http://tinyurl.com/ru6aygk for an example.

In JSON-LD 1.1, the solution is to add "@prefix": true to prefixes that end in "_" or other characters. Since we're still waiting for a 1.1 Python implementation, the solution will have to be to expand the CURIE's of non-"standard" prefixes for the immediate turn.

@balhoff
Copy link
Contributor Author

balhoff commented Feb 14, 2020

I never knew about that restriction. I feel like we have been using underscore-terminated prefixes in our contexts (e.g. in GO) for quite a while without issue. Maybe it's a difference in the implementation we're using; I mostly have experience with json-ld-java (this is used in ROBOT).

@hsolbrig
Copy link
Member

We've raised the following question:

Just to double check - in JSON-LD 1.0, there is no way to make the following work:

    {   "@context": {
          "CHEBI": "http://example.org/CHEBI_"
        },
       "CHEBI:item1": true
   }

On w3c/json-ld-syntax#329

It appears that there was an addendum to the JSON-LD 1.0 spec that caused the above item

@cmungall
Copy link
Collaborator

This is worrying, it goes beyond biolinkml and prefixcommons..

@hsolbrig
Copy link
Member

Yup -- at this point we need to be sure that we address it thoroughly in the JSON-LD 1.1 spec. Note that it works fine if you're just parsing the context as a plain old JSON file, but rdflib won't see it as a prefix. For the short term (~3 months) we are planning to publish a fork of rdflib-jsonld that addresses this (although we do need to keep an eye out for the issue that caused it to be implemented in the first place). Be interested on your take on the:

{
    "@context": {
        "@prefix" : {
           "CHEBI" : "http://exampl.org/CHEBI_"
           ...
       }
   }
}

proposal for the longer term

@balhoff
Copy link
Contributor Author

balhoff commented Jul 24, 2020

It doesn't seem like we can wait for the JSON-LD spec to change in order to fix this incorrect prefix expansion (which is a fairly urgent problem to me). I think we should manage prefixes in a basic YAML file (which is not a JSON-LD context), and then have a separate build step that generates a more verbose JSON-LD context that will produce the correct expansions. If anyone supports this idea, we could close this ticket and open a ticket do that instead.

@TomConlin
Copy link

+1 for a stand alone yaml file of :

  • common cure-prefix
    to
  • owl/ontology/KG/machine preferred base-uri

@hsolbrig
Copy link
Member

As a follow up, the RDFLIB JSON-LD library fix did not work -- without the URI pattern match, a lot of things that weren't intended be prefixes ended up being interpreted as such. The patch has been withdrawn.

+1 on the stand-alone yaml file as the default. We can generate an automatic transformation to the JSON-LD context for those who use it directly, although it will be interesting to see what 1.0 processors do with it...

@balhoff
Copy link
Contributor Author

balhoff commented Jul 27, 2020

@hsolbrig thanks! Maybe we need to generate two JSON-LD contexts. 😉

@hsolbrig
Copy link
Member

Should we consider shifting this discussion to https://github.com/prefixcommons or https://github.com/prefixcommons/biocontext ? I think the only way to find out is to run unit tests and see what breaks, but I'd assume that the majority of them are on prefixcommons side

@balhoff
Copy link
Contributor Author

balhoff commented Jul 28, 2020

I'm closing this issue in favor of the proposal in #397.

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

7 participants