-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ont-api: 4.0.0-SNAPSHOT -- java-17 + jena-ontapi-5.1.0, related fixin…
…g and refactoring
- Loading branch information
Showing
245 changed files
with
1,532 additions
and
1,504 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.github.owlcs.ontapi; | ||
|
||
import org.apache.jena.graph.Node; | ||
import org.apache.jena.graph.NodeFactory; | ||
|
||
import java.io.Serializable; | ||
|
||
public record BlankNodeId(String label) implements AsNode, Serializable { | ||
|
||
public static BlankNodeId of(Node node) { | ||
if (node.isBlank()) { | ||
return new BlankNodeId(node.getBlankNodeLabel()); | ||
} | ||
throw new IllegalArgumentException(); | ||
} | ||
|
||
public static BlankNodeId of(String id) { | ||
return new BlankNodeId(id); | ||
} | ||
|
||
public static BlankNodeId of() { | ||
return new BlankNodeId(org.apache.jena.graph.BlankNodeId.createFreshId()); | ||
} | ||
|
||
@Override | ||
public Node asNode() { | ||
return NodeFactory.createBlankNode(label); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return label; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return label.hashCode(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.