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

getIdentifier should work with non-obolibrary PURLs (required for solr loading) #245

Closed
cmungall opened this issue Apr 9, 2018 · 6 comments
Assignees

Comments

@cmungall
Copy link
Member

cmungall commented Apr 9, 2018

OWLGraphWrapperExtended

	/**
	 * gets the OBO-style ID of the specified object. E.g. "GO:0008150"
	 * 
	 * @param iriId
	 * @return OBO-style identifier, using obo2owl mapping
	 */
	public String getIdentifier(IRI iriId) {
		return Owl2Obo.getIdentifier(iriId);
	}

Instead it should:

  1. Check if the IRI starts with the obolib prefix, if yes, use Owl2Obo.getIdentifier
  2. If no, check if oboInOw#id is present. if so, use it

In future we may also want the ability to use prefixcommons curie util to do this in a custom way

@cmungall
Copy link
Member Author

Test case:

Prefix: GO: <http://purl.obolibrary.org/obo/GO_>
Prefix: x <http://example.org/>
Prefix: oboInOwl: <http://www.geneontology.org/formats/oboInOwl#>

Ontology: <http://purl.obolibrary.org/obo/test>

AnnotationProperty: oboInOwl:id
        
Class: GO:0000001
    Annotations:
        rdfs:label "test1"

Class: GO:0000002
    Annotations:
        rdfs:label "test2",
        oboInOwl:id "FAKE:1234"

Class: x:005
    Annotations:
        rdfs:label "test3",
        oboInOwl:id "X:5"

The IDs should be GO:0000001, GO:0000002, X:5

@cmungall
Copy link
Member Author

One more test

Class: x:010
    Annotations:
        rdfs:label "test4"

should preserve URL

@cmungall
Copy link
Member Author

@yy20716 can you add one more test, as above?

@yy20716
Copy link
Contributor

yy20716 commented Apr 24, 2018

Thank you for your reminder. I added that case in this pull request.

@yy20716
Copy link
Contributor

yy20716 commented May 8, 2018

I guess this issue can be closed but please let me know if you encounter any other problems. Thank you.

@kltm
Copy link
Member

kltm commented May 8, 2018

Looking good so far.

@kltm kltm closed this as completed May 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants