Skip to content
This repository has been archived by the owner on Jan 8, 2019. It is now read-only.

DM2E/dm2e-ws

Repository files navigation

dm2e-ws

DM2E Webservices

Summary:

Here, you can find the webservices that are developed as part of the DM2E infrastructure.

Instructions:

  • Install Git, JDK, and Maven.
  • git clone [email protected]:DM2E/dm2e-ws.git
  • mvn compile
  • bash bin/gui-console.sh

Test:

source curl_rest.sh
GET $SRV/service/xslt
GETT $SRV/service/xslt 
GETJ $SRV/service/xslt 
  • Open https://localhost:9998/data in your browser
  • A webservice description in RDF should be shown (depending on your browser settings, you have to look at the page source.)

Post Test:

curl --data "[] https://purl.org/dc/terms/creator https://localhost/kai; https://www.w3.org/1999/02/22-rdf-syntax-ns#type https://onto.dm2e.eu/omnom/WebServiceConfig ." https://localhost:9998/data/configurations

This should return your RDF data and replace the blank node with a new URI.

Have fun!

Grafeo

Grafeo is an easy to use RDF framework.

Create a grafeo:

Grafeo g1 = new GrafeoImpl();
Grafeo g2 = new GrafeoImpl("https://foo.bar/x.rdf"); // load from URI, guess format
Grafeo g3 = new GrafeoImpl("<https://foo/res1> <https://foo/prop1> <https://foo/res2>", true); // load from String, guess format

Add statements:

g.addTriple("https://foo/res1", "rdf:type", "https://foo/res2"); // can use URI or qname, common prefixes pre-defined
g.setNamespace("foo", "https://foo/");
g.addTriple("foo:res1", "rdf:type", "foo:res2"); // same thing

Serialize it:

System.out.println(g.getNTriples());
System.out.println(g.getTurtle());
System.out.println(g.getTerseTurtle()); // Turtle sans the @prefix, not valid but easier to read

Publish it:

g.putToEndpoint("https://endpoint", "htttp:https://name-of-the-graph-to-put-to"); // this empties the graph first
g.postToEndpoint("https://endpoint", "htttp:https://name-of-the-graph-to-put-to"); // this adds the statements to the graph

Releases

No releases published

Packages

No packages published