Skip to content

Commit

Permalink
- Add preferredPrefix in rdf2json
Browse files Browse the repository at this point in the history
- Change curie logic linker pass 1
  • Loading branch information
haideriqbal committed Aug 19, 2024
1 parent 931c002 commit d3da8e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dataload/linker/src/main/java/LinkerPass1.java
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ public static LinkerPass1Result run(String inputJsonFilename) throws IOException
if(curieObject.has("value")) {
String curieValue = curieObject.get("value").getAsString();
if(!curieValue.contains(":")) {
curieValue = entry.getValue().definingOntologyIds.iterator().next().toUpperCase() + ":" + curieValue;
var definingOntologyId = entry.getValue().definingOntologyIds.iterator().next();
curieValue = entry.getValue().ontologyIdToDefinitions.get(definingOntologyId).curie.getAsJsonObject().get("value").getAsString();
curieObject.addProperty("value", curieValue);
result.iriToDefinitions.put(entry.getKey(), definitions);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ public static void annotateShortForms(OntologyGraph graph) {
if(c.uri == null)
continue;

if (preferredPrefix == null || preferredPrefix.isEmpty()) {
preferredPrefix = graph.config.get("id").toString().toUpperCase();
}

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

0 comments on commit d3da8e0

Please sign in to comment.