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

Implement CURIE handling #24

Closed
cmungall opened this Issue May 12, 2016 · 11 comments

Comments

Projects
None yet
5 participants
@cmungall
Member

cmungall commented May 12, 2016

Clients should be able to use CURIEs

Currently v3 expects full IRIs

handling could be in services layer or core; core would be better

@cmungall cmungall added this to the Use in Production milestone May 12, 2016

@kshefchek

This comment has been minimized.

Show comment
Hide comment
@kshefchek
Member

kshefchek commented Oct 5, 2016

+1

@cmungall

This comment has been minimized.

Show comment
Hide comment
@cmungall

cmungall Oct 6, 2016

Member

Maybe this should be a separate library? ccing @balhoff who is facing something similar for minerva. @jamesaoverton wrote IOUtils in ROBOT which could be a good starting point for a separate module. Or is that overengineering?

Member

cmungall commented Oct 6, 2016

Maybe this should be a separate library? ccing @balhoff who is facing something similar for minerva. @jamesaoverton wrote IOUtils in ROBOT which could be a good starting point for a separate module. Or is that overengineering?

@jamesaoverton

This comment has been minimized.

Show comment
Hide comment
@jamesaoverton

jamesaoverton Oct 7, 2016

ROBOT's IOHelper uses OWLAPI's PrefixManager and some JSON-LD stuff. You're welcome to use it, of course, or we can try and factor it out somehow.

I've built a dozen simple systems with prefix maps and match-and-replace over the years. That's a lot lighter if you don't need more features.

jamesaoverton commented Oct 7, 2016

ROBOT's IOHelper uses OWLAPI's PrefixManager and some JSON-LD stuff. You're welcome to use it, of course, or we can try and factor it out somehow.

I've built a dozen simple systems with prefix maps and match-and-replace over the years. That's a lot lighter if you don't need more features.

@cmungall

This comment has been minimized.

Show comment
Hide comment
@cmungall

cmungall Oct 7, 2016

Member

For this, we need something super-lightweight, single level of expansion/contraction iri<->curie, with defined behavior and rules for ambiguity in the contraction.

It would be useful to have a general library that uses the json-ld standard to allow for contraction/expansion from arbitrary short forms, using a context file. I think this should be straightforward too

Member

cmungall commented Oct 7, 2016

For this, we need something super-lightweight, single level of expansion/contraction iri<->curie, with defined behavior and rules for ambiguity in the contraction.

It would be useful to have a general library that uses the json-ld standard to allow for contraction/expansion from arbitrary short forms, using a context file. I think this should be straightforward too

@balhoff

This comment has been minimized.

Show comment
Hide comment
@balhoff

balhoff Oct 10, 2016

Member

Unfortunately JSON-LD context is a lot less straightforward than one might think. The contraction & expansion is dependent on how the term is used in JSON (e.g. JSON property vs. value for @type property vs. value for other properties, etc.). Then there is interplay with @base and @vocab (which also depend on usage position in JSON). So you kind of need a real JSON-LD library to parse the context, which is what both robot and pxftools do. This can still be wrapped in a simple API. In pxftools I started with robot's approach and added a parameter to the expansion methods so you could say whether you want it to happen as a property or class vs. as an instance.

Member

balhoff commented Oct 10, 2016

Unfortunately JSON-LD context is a lot less straightforward than one might think. The contraction & expansion is dependent on how the term is used in JSON (e.g. JSON property vs. value for @type property vs. value for other properties, etc.). Then there is interplay with @base and @vocab (which also depend on usage position in JSON). So you kind of need a real JSON-LD library to parse the context, which is what both robot and pxftools do. This can still be wrapped in a simple API. In pxftools I started with robot's approach and added a parameter to the expansion methods so you could say whether you want it to happen as a property or class vs. as an instance.

@jnguyenx

This comment has been minimized.

Show comment
Hide comment
@jnguyenx

jnguyenx Nov 22, 2016

Collaborator

@cmungall can you provide a JSON-LD file example? Or you prefer to go the yaml way?

Collaborator

jnguyenx commented Nov 22, 2016

@cmungall can you provide a JSON-LD file example? Or you prefer to go the yaml way?

@jamesaoverton

This comment has been minimized.

Show comment
Hide comment
@jnguyenx

This comment has been minimized.

Show comment
Hide comment

jnguyenx added a commit that referenced this issue Dec 16, 2016

jnguyenx added a commit that referenced this issue Dec 17, 2016

jnguyenx added a commit that referenced this issue Dec 17, 2016

@jnguyenx

This comment has been minimized.

Show comment
Hide comment
@jnguyenx

jnguyenx Jan 27, 2017

Collaborator

Some matchers throw CURIEs exceptions:
http://owlsim3.monarchinitiative.org/api/match/bayesian-network?id=HP%3A0001347&id=HP%3A0000718&id=HP%3A0001332&id=HP%3A0001268&id=HP%3A0001257&id=HP%3A0006892

To investigate

ERROR [2017-01-27 00:37:45,248] io.dropwizard.jersey.errors.LoggingExceptionMapper: Error handling a request: 213e7af645d9a3a6
! java.lang.IllegalStateException: Optional.get() cannot be called on an absent value
! at com.google.common.base.Absent.get(Absent.java:47) ~[owlsim-services-3.0-SNAPSHOT.jar:na]
! at org.monarchinitiative.owlsim.kb.impl.BMKnowledgeBaseOWLAPIImpl.getOWLClass(BMKnowledgeBaseOWLAPIImpl.java:1010) ~[owlsim-services-3.0-SNAPSHOT.jar:na]
! at org.monarchinitiative.owlsim.kb.impl.BMKnowledgeBaseOWLAPIImpl.getClassIndex(BMKnowledgeBaseOWLAPIImpl.java:628) ~[owlsim-services-3.0-SNAPSHOT.jar:na]
! at org.monarchinitiative.owlsim.compute.cpt.impl.ThreeStateConditionalProbabilityIndex.calculateConditionalProbabilities(ThreeStateConditionalProbabilityIndex.java:107) ~[owlsim-services-3.0-SNAPSHOT.jar:na]
! at org.monarchinitiative.owlsim.compute.matcher.impl.ThreeStateBayesianNetworkProfileMatcher.calculateConditionalProbabilities(ThreeStateBayesianNetworkProfileMatcher.java:137) ~[owlsim-services-3.0-SNAPSHOT.ja
r:na]
Collaborator

jnguyenx commented Jan 27, 2017

Some matchers throw CURIEs exceptions:
http://owlsim3.monarchinitiative.org/api/match/bayesian-network?id=HP%3A0001347&id=HP%3A0000718&id=HP%3A0001332&id=HP%3A0001268&id=HP%3A0001257&id=HP%3A0006892

To investigate

ERROR [2017-01-27 00:37:45,248] io.dropwizard.jersey.errors.LoggingExceptionMapper: Error handling a request: 213e7af645d9a3a6
! java.lang.IllegalStateException: Optional.get() cannot be called on an absent value
! at com.google.common.base.Absent.get(Absent.java:47) ~[owlsim-services-3.0-SNAPSHOT.jar:na]
! at org.monarchinitiative.owlsim.kb.impl.BMKnowledgeBaseOWLAPIImpl.getOWLClass(BMKnowledgeBaseOWLAPIImpl.java:1010) ~[owlsim-services-3.0-SNAPSHOT.jar:na]
! at org.monarchinitiative.owlsim.kb.impl.BMKnowledgeBaseOWLAPIImpl.getClassIndex(BMKnowledgeBaseOWLAPIImpl.java:628) ~[owlsim-services-3.0-SNAPSHOT.jar:na]
! at org.monarchinitiative.owlsim.compute.cpt.impl.ThreeStateConditionalProbabilityIndex.calculateConditionalProbabilities(ThreeStateConditionalProbabilityIndex.java:107) ~[owlsim-services-3.0-SNAPSHOT.jar:na]
! at org.monarchinitiative.owlsim.compute.matcher.impl.ThreeStateBayesianNetworkProfileMatcher.calculateConditionalProbabilities(ThreeStateBayesianNetworkProfileMatcher.java:137) ~[owlsim-services-3.0-SNAPSHOT.ja
r:na]
@jnguyenx

This comment has been minimized.

Show comment
Hide comment
@jnguyenx

jnguyenx Mar 3, 2017

Collaborator

This error was thrown due to a missing prefix for http://uri.neuinfo.org/nif/nifstd/nlx_28443. In case of a not found curie, the IRI will be used as output.

Note that the above query still fails, but it seems to be due to the matcher itself.

Collaborator

jnguyenx commented Mar 3, 2017

This error was thrown due to a missing prefix for http://uri.neuinfo.org/nif/nifstd/nlx_28443. In case of a not found curie, the IRI will be used as output.

Note that the above query still fails, but it seems to be due to the matcher itself.

@jnguyenx jnguyenx closed this Mar 3, 2017

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