Giter VIP home page Giter VIP logo

stardog-examples's Introduction

Examples of using and extending Stardog

This is a small collection of examples of working with Stardog via its APIs, as well as examples of how to use some of the extension points within Stardog.

How to build examples

First, you'll need a valid Stardog download.

For the examples in examples/api and examples/function, you'll need Gradle.

To compile or run the examples, gradle will automatically download the dependencies from our public maven repository:

gradle compileJava

To run the examples, they require a valid $STARDOG_HOME; you can provide this via the parameter stardog.home (eg -PstardogHome=/my/stardog/home).

To run any of the examples, you can use the Gradle execute task. By default, this will run the ConnectionAPIExample program, but you can specify the fully-qualified class name of any of the other examples using the mainClass parameter.

gradle execute -PmainClass=com.complexible.stardog.examples.ICVExample

Generating Documentation

The Stardog documentation and its javadocs are a good place to start. But some examples in this repository are annotated using Markdown; they can be processed by Docco.

If you don't have Docco installed, it's pretty easy to get started:

sudo npm install -g docco

Then, you can run it directly against any example:

docco -o docs main/src/com/complexible/stardog/api/ConnectionAPIExample.java

Or you can use the supplied gradle docs task in each build file that will run Docco against all annotated source files.

Service Loading

You'll notice that a number of examples have in their source a directory META-INF/services, these are the service registrations for each example.

Stardog uses the JDK ServiceLoader to load new services at runtime and make them available to the various parts of the system. The files in the services directory should be the fully qualified class name of the class/service, such as com.complexible.stardog.plan.filter.functions.Function, and the contents of the file should be a list of the fully qualified class names of the implementations of that service.

These need to be a part of your classpath, usually embedded in the jar file with the compiled source, in order for the ServiceLoader to make them up.

stardog-examples's People

Contributors

mhgrove avatar kendall avatar mikesoren avatar hekanibru avatar

Stargazers

Roman avatar

Watchers

Valentino Hudhra avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.