Created
May 11, 2023 10:03
-
-
Save afs/784a757fea4bf10d984e5985da148593 to your computer and use it in GitHub Desktop.
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
public static void main(String...args) { | |
Model model = ModelFactory.createDefaultModel(); | |
Resource subject1 = ResourceFactory.createResource("http://example/s1"); | |
Resource subject2 = ResourceFactory.createResource("http://example/s2"); | |
Property property = ResourceFactory.createProperty("http://example/p"); | |
Long longValue = 6L; | |
model.addLiteral(subject1, property, ResourceFactory.createTypedLiteral(longValue.toString(), XSDDatatype.XSDlong)); | |
model.addLiteral(subject2, property, longValue); | |
RDFWriter.source(model).lang(Lang.TTL).output(System.out); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment