Permalink
Browse files

[#24] if no curie mapping is provided, use IRI as failover

  • Loading branch information...
1 parent d4b2bfb commit f789e8d2b16da6418ce5056e22d23b9bf64c8e21 @jnguyenx jnguyenx committed Dec 19, 2016
@@ -170,11 +170,12 @@ public void setKbMetdata(KBMetadata kbMetdata) {
this.kbMetdata = kbMetdata;
}
-
-
private String getShortForm(IRI iri) {
- // TODO not great to have a mix of IRI and CURIE
- return curieUtil.getCurie(iri.toString()).or(iri.toString());
+ if (curieUtil.getCurieMap().isEmpty()) {
+ return iri.toString();
+ } else {
+ return curieUtil.getCurie(iri.toString()).get();
+ }
}
private void populateLabelsFromOntology(LabelMapper labelMapper, OWLOntology ontology) {
@@ -996,9 +997,11 @@ protected String getIdentifier(OWLNamedObject obj) {
*/
protected OWLClass getOWLClass(String id) {
Preconditions.checkNotNull(id);
- // TODO not great to have a mix of IRI and CURIE
- String iri = curieUtil.getIri(id).or(id);
- return getOWLClass(IRI.create(iri));
+ if (curieUtil.getCurieMap().isEmpty()) {
+ return getOWLClass(IRI.create(id));
+ } else {
+ return getOWLClass(IRI.create(curieUtil.getIri(id).get()));
+ }
}
/**
@@ -1023,9 +1026,11 @@ protected OWLNamedIndividual getOWLNamedIndividual(IRI iri) {
*/
public OWLNamedIndividual getOWLNamedIndividual(String id) {
Preconditions.checkNotNull(id);
- // TODO not great to have a mix of IRI and CURIE
- String iri = curieUtil.getIri(id).or(id);
- return getOWLNamedIndividual(IRI.create(iri));
+ if (curieUtil.getCurieMap().isEmpty()) {
+ return getOWLNamedIndividual(IRI.create(id));
+ } else {
+ return getOWLNamedIndividual(IRI.create(curieUtil.getIri(id).get()));
+ }
}
public Attribute getAttribute(String id) {

0 comments on commit f789e8d

Please sign in to comment.