Skip to content

mchlrch/rdf4j-utils2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

rdf4j-utils2

Utililty code related to rdf4j.

ModelBuilderFacade

The ModelBuilderFacade is a (partial) facade over the rdf4j ModelBuilder. It includes some convenience methods for adding collections and for skipping over nullable values.

Usage example:

Namespace nsData = new SimpleNamespace("", "http://data.example.org/");

ModelBuilderFacade mbf = new ModelBuilderFacade(nsData);

// shaka is likely, but not guaranteed
String shaka = Math.random() >= 0.1 ? "hang loose" : null;

mbf.subject(":Hawaii")
   .addEach("rdfs:label", Arrays.asList("Hawaiʻi", "Big Island"))
   .addNullable("rdfs:comment", shaka);

For more examples, have a look at the unit tests.

About

Utililty code related to rdf4j

Topics

Resources

License

Stars

Watchers

Forks

Languages