Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
[#72] added service for single entity #73
Conversation
jnguyenx
requested a review
from cmungall
Mar 16, 2017
| + throws UnknownFilterException, IncoherentStateException { | ||
| + | ||
| + // TODO it's weird to resolve the curie here | ||
| + String resolveEntity = curieUtil.getIri(entity).orElse(entity); |
julesjacobsen
Mar 17, 2017
Contributor
This is a common pattern using the CurieUtil - might be worth providing a toIriString() method?
| + required = true) @PathParam("ontology") String ontology) | ||
| + throws UnknownFilterException, IncoherentStateException { | ||
| + | ||
| + // TODO it's weird to resolve the curie here |
julesjacobsen
Mar 17, 2017
Contributor
But you're passing the entity into the ClassMatcher via the matchEntity() method so you have the curieUtil accessible from you in there and don't need to do it here.
jnguyenx
Mar 17, 2017
Collaborator
You mean passing the CurieUtil as a parameter of matchEntity()?
I'm wondering if the ClassMatcher should have a CurieUtil in the constructor, what do you think?
julesjacobsen
Mar 20, 2017
•
Contributor
Ahh, no sorry - I'm mistaken. The curieUtil is used internally within the BMKnowledgebase, but is not accessible from it. Providing the ClassMatcher with the curieUtil and bmKnowledgeBase in the constructor would solve this. Then you can move
String resolveEntity = curieUtil.getIri(entity).orElse(entity); into the ClassMatcher.
I just wonder to what extent we need to hide the CurieUtil inside the BMKnowledgeBase - presumably we're always going to use the OWLAPI and the CurieUtil in the BMKnowledgeBase? If that's the case and these are going to be required externally to query the BMKnowledgeBase, then it should expose them so they can be used, or provide methods like:
public String resolveIri(String entity)
return curieUtil.getIri(entity).orElse(entity);
jnguyenx
Mar 20, 2017
Collaborator
Yep I was also leaning towards that solution, I'll make that change in my PR!
Thanks!
julesjacobsen
Mar 21, 2017
•
Contributor
I meant to add the resolveIri() method to the BMKnowledgeBase interface, in case I wasn't clear - which I wasn't!
|
My intent was to use the curieUtil when constructing the KB, and to use curies internally, obviating the need for multiple classes to know about it. Exposing via services is a good idea, for clients that speak URIs |
|
Okay modified! |
|
@julesjacobsen @cmungall when you have time, can you have a look? |
jnguyenx commentedMar 16, 2017
I'm not sure about the expected output, can you please have a look at the unit test?