Skip to content

Java API

Paul Cuddihy GE Research edited this page Oct 26, 2020 · 21 revisions

Getting SemTK

For the Java API, you'll need sparqlGraphLibrary.

Compiled jars

The snapshots will have the latest improvements, and may be slightly less stable than the releases.

  1. Find sparqlGraphLibrary jars on sonatype Nexus Repo Manager, or perform a more general search of semtk jars on sonatype

  2. Copy the desired dependency from the Maven tab into your pom.xml.

  3. The sonatype repos can be in your pom.xml as shown here (alternatively, it can be in your .m2/settings.xml) Releases are also synced to Maven Central.

<repository>
    <id>sonatype</id>
    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
<snapshotRepository>
    <id>sonatype</id>
    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>

Use a standalone Jar

A pre-build version of SemTk including (prebuilt docker containers) will contain standaloneExecutables/target/standaloneExecutables-jar-with-dependencies.jar

This jar can be extracted and added to your new project's CLASS_PATH.

Java API Demo

The module sparqlGraphLibrary contains java clients which perform SemTk operations via REST calls.

The most commonly used features of SemTk are demonstrated in JavaApiDemo.java

This demo can be run with the command:

java -cp PATH_TO_SEMTK/standaloneExecutables/target/standaloneExecutables-jar-with-dependencies.jar: com.ge.research.semtk.demo.JavaApiDemo fuseki http://localhost:3030/DATASET

Java Docs

See the SemTk API javadocs

SPARQLgraph

Clone this wiki locally