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

API-TEST: Update Curie Formation Logic #755

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,10 @@ public boolean diff() throws FileNotFoundException {
continue;
}

if(jsonA.equals(jsonB)) {
System.out.println(inputDir + filename + " was equal to " + expectedDir + filename);
} else {
if(!jsonA.equals(jsonB)) {
System.out.println(inputDir + filename + " differed from " + expectedDir + filename);
success = false;
}

}

return success;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,21 @@ public static void annotateShortForms(OntologyGraph graph) {
}

String shortForm = extractShortForm(graph, ontologyBaseUris, preferredPrefix, c.uri);
String curie = shortForm.replaceFirst("_", ":");

/*
CURIEs are formed by following rules:
If there is only one underscore "_" AND the characters after the underscore are numbers then replace the underscore with colon ":"
If there is only one underscore "_" and the characters after the underscore are not just numbers then just keep the curie same as shortform
If there are multiple underscore but has only digits after the last underscore then the code replaces the last underscore with a colon
*/

String curie = shortForm.replaceFirst("_(\\d+)$", ":$1");
c.properties.addProperty("shortForm", PropertyValueLiteral.fromString(shortForm));
c.properties.addProperty("curie", PropertyValueLiteral.fromString(curie));
}
}
long endTime3 = System.nanoTime();
logger.info("annotate short forms: {}", ((endTime3 - startTime3) / 1000 / 1000 / 1000));


}

private static String extractShortForm(OntologyGraph graph, Set<String> ontologyBaseUris, String preferredPrefix,
Expand Down
594 changes: 297 additions & 297 deletions testcases_expected_output/annotation-properties/gitIssue502/classes.jsonl

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"id:ID",":LABEL","_json","iri","numberOfIndividuals:string[]","linkedEntities:string[]","ontology_purl:string[]","numDescendants:string[]","numberOfProperties:string[]","numberOfClasses:string[]","language:string[]","numHierarchicalDescendants:string[]","isObsolete:string[]","label:string[]","importsFrom:string[]","type:string[]","directAncestor:string[]","exportsTo:string[]","base_uri:string[]","http__//www.w3.org/2000/01/rdf-schema#comment:string[]","imported:string[]","numberOfEntities:string[]","ontologyId:string[]","http__//www.w3.org/2000/01/rdf-schema#label:string[]","definition:string[]","http__//www.w3.org/1999/02/22-rdf-syntax-ns#type:string[]"
"oio+ontology+http://www.geneontology.org/formats/oboInOwl","Ontology","{""ontologyId"":""oio"",""importsFrom"":[],""exportsTo"":[""gitissue502""],""iri"":""http://www.geneontology.org/formats/oboInOwl"",""ontology_purl"":""https://gist.githubusercontent.com/haideriqbal/4a2b1a9aa81d9fa26cae81e0b0b7730b/raw/527665128b9be9d7d6133f9a796379600151c737/oboInOwl.owl"",""base_uri"":[""http://www.geneontology.org/formats/oboInOwl#""],""type"":[""ontology""],""definition"":[{""type"":[""literal""],""value"":""OBO Format metamodel. This meta-ontology is self-describing. OBO metamodel properties are described using OBO metamodel properties""},{""type"":[""literal""],""value"":""\n This is an OWL translation of an ontology whose native representational form is .obo. The translation was performed using the oboInOwl xslt library. For details, see http://www.berkeleybop.org/obo-conv.cgi\n ""}],""directAncestor"":[],""http://www.w3.org/1999/02/22-rdf-syntax-ns#type"":""http://www.w3.org/2002/07/owl#Ontology"",""http://www.w3.org/2000/01/rdf-schema#comment"":[{""type"":[""literal""],""value"":""OBO Format metamodel. This meta-ontology is self-describing. OBO metamodel properties are described using OBO metamodel properties""},{""type"":[""literal""],""value"":""\n This is an OWL translation of an ontology whose native representational form is .obo. The translation was performed using the oboInOwl xslt library. For details, see http://www.berkeleybop.org/obo-conv.cgi\n ""}],""http://www.w3.org/2000/01/rdf-schema#label"":{""type"":[""literal""],""value"":""""},""imported"":false,""isObsolete"":false,""label"":{""type"":[""literal""],""value"":""""},""language"":{""type"":[""literal""],""value"":""en""},""numDescendants"":0.0,""numHierarchicalDescendants"":0.0,""numberOfClasses"":{""type"":[""literal""],""value"":""12""},""numberOfEntities"":{""type"":[""literal""],""value"":""56""},""numberOfIndividuals"":{""type"":[""literal""],""value"":""0""},""numberOfProperties"":{""type"":[""literal""],""value"":""44""},""searchableAnnotationValues"":[false,{""type"":[""literal""],""value"":""en""},{""type"":[""literal""],""value"":""12""},{""type"":[""literal""],""value"":""56""},{""type"":[""literal""],""value"":""0""},{""type"":[""literal""],""value"":""44""}],""linkedEntities"":{""http://www.w3.org/2000/01/rdf-schema#comment"":{""definedBy"":[""rdfs""],""numAppearsIn"":2.0,""hasLocalDefinition"":false,""label"":{""type"":[""literal""],""value"":""comment""},""curie"":{""type"":[""literal""],""value"":""RDFS:comment""},""type"":[""property"",""entity""]},""http://www.w3.org/2000/01/rdf-schema#label"":{""definedBy"":[""rdfs""],""numAppearsIn"":3.0,""hasLocalDefinition"":false,""label"":{""type"":[""literal""],""value"":""label""},""curie"":{""type"":[""literal""],""value"":""RDFS:label""},""type"":[""property"",""entity""]}}}","http://www.geneontology.org/formats/oboInOwl","0","","https://gist.githubusercontent.com/haideriqbal/4a2b1a9aa81d9fa26cae81e0b0b7730b/raw/527665128b9be9d7d6133f9a796379600151c737/oboInOwl.owl","0.0","44","12","en","0.0","false","","","ontology","","gitissue502","http://www.geneontology.org/formats/oboInOwl#","OBO Format metamodel. This meta-ontology is self-describing. OBO metamodel properties are described using OBO metamodel properties|
"oio+ontology+http://www.geneontology.org/formats/oboInOwl","Ontology","{""ontologyId"":""oio"",""importsFrom"":[],""exportsTo"":[""gitissue502""],""iri"":""http://www.geneontology.org/formats/oboInOwl"",""ontology_purl"":""https://gist.githubusercontent.com/haideriqbal/4a2b1a9aa81d9fa26cae81e0b0b7730b/raw/527665128b9be9d7d6133f9a796379600151c737/oboInOwl.owl"",""base_uri"":[""http://www.geneontology.org/formats/oboInOwl#""],""type"":[""ontology""],""definition"":[{""type"":[""literal""],""value"":""OBO Format metamodel. This meta-ontology is self-describing. OBO metamodel properties are described using OBO metamodel properties""},{""type"":[""literal""],""value"":""\n This is an OWL translation of an ontology whose native representational form is .obo. The translation was performed using the oboInOwl xslt library. For details, see http://www.berkeleybop.org/obo-conv.cgi\n ""}],""directAncestor"":[],""http://www.w3.org/1999/02/22-rdf-syntax-ns#type"":""http://www.w3.org/2002/07/owl#Ontology"",""http://www.w3.org/2000/01/rdf-schema#comment"":[{""type"":[""literal""],""value"":""OBO Format metamodel. This meta-ontology is self-describing. OBO metamodel properties are described using OBO metamodel properties""},{""type"":[""literal""],""value"":""\n This is an OWL translation of an ontology whose native representational form is .obo. The translation was performed using the oboInOwl xslt library. For details, see http://www.berkeleybop.org/obo-conv.cgi\n ""}],""http://www.w3.org/2000/01/rdf-schema#label"":{""type"":[""literal""],""value"":""""},""imported"":false,""isObsolete"":false,""label"":{""type"":[""literal""],""value"":""""},""language"":{""type"":[""literal""],""value"":""en""},""numDescendants"":0.0,""numHierarchicalDescendants"":0.0,""numberOfClasses"":{""type"":[""literal""],""value"":""12""},""numberOfEntities"":{""type"":[""literal""],""value"":""56""},""numberOfIndividuals"":{""type"":[""literal""],""value"":""0""},""numberOfProperties"":{""type"":[""literal""],""value"":""44""},""searchableAnnotationValues"":[false,{""type"":[""literal""],""value"":""en""},{""type"":[""literal""],""value"":""12""},{""type"":[""literal""],""value"":""56""},{""type"":[""literal""],""value"":""0""},{""type"":[""literal""],""value"":""44""}],""linkedEntities"":{""http://www.w3.org/2000/01/rdf-schema#comment"":{""definedBy"":[""rdfs""],""numAppearsIn"":2.0,""hasLocalDefinition"":false,""label"":{""type"":[""literal""],""value"":""comment""},""curie"":{""type"":[""literal""],""value"":""RDFS_comment""},""type"":[""property"",""entity""]},""http://www.w3.org/2000/01/rdf-schema#label"":{""definedBy"":[""rdfs""],""numAppearsIn"":3.0,""hasLocalDefinition"":false,""label"":{""type"":[""literal""],""value"":""label""},""curie"":{""type"":[""literal""],""value"":""RDFS_label""},""type"":[""property"",""entity""]}}}","http://www.geneontology.org/formats/oboInOwl","0","","https://gist.githubusercontent.com/haideriqbal/4a2b1a9aa81d9fa26cae81e0b0b7730b/raw/527665128b9be9d7d6133f9a796379600151c737/oboInOwl.owl","0.0","44","12","en","0.0","false","","","ontology","","gitissue502","http://www.geneontology.org/formats/oboInOwl#","OBO Format metamodel. This meta-ontology is self-describing. OBO metamodel properties are described using OBO metamodel properties|
This is an OWL translation of an ontology whose native representational form is .obo. The translation was performed using the oboInOwl xslt library. For details, see http://www.berkeleybop.org/obo-conv.cgi
","false","56","oio","","OBO Format metamodel. This meta-ontology is self-describing. OBO metamodel properties are described using OBO metamodel properties|
This is an OWL translation of an ontology whose native representational form is .obo. The translation was performed using the oboInOwl xslt library. For details, see http://www.berkeleybop.org/obo-conv.cgi
Expand Down
Loading
Loading