Skip to content

Commit ede9ada

Browse files
acoburntimea-solid
andauthored
JCL-190: Use commons-rdf (inrupt#187)
* JCL-190: Use commons-rdf Co-authored-by: Timea Turdean <[email protected]>
1 parent 14fc352 commit ede9ada

51 files changed

Lines changed: 460 additions & 3851 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

api/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
<groupId>commons-io</groupId>
2424
<artifactId>commons-io</artifactId>
2525
</dependency>
26+
<dependency>
27+
<groupId>org.apache.commons</groupId>
28+
<artifactId>commons-rdf-api</artifactId>
29+
</dependency>
2630
<dependency>
2731
<groupId>org.slf4j</groupId>
2832
<artifactId>slf4j-api</artifactId>

api/src/main/java/com/inrupt/client/Resource.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,18 @@
2020
*/
2121
package com.inrupt.client;
2222

23-
import com.inrupt.client.rdf.Dataset;
24-
import com.inrupt.client.rdf.Syntax;
23+
import com.inrupt.client.spi.RDFFactory;
2524
import com.inrupt.client.spi.RdfService;
2625
import com.inrupt.client.spi.ServiceProvider;
2726

2827
import java.io.IOException;
2928
import java.io.OutputStream;
3029
import java.net.URI;
3130

31+
import org.apache.commons.rdf.api.Dataset;
32+
import org.apache.commons.rdf.api.RDF;
33+
import org.apache.commons.rdf.api.RDFSyntax;
34+
3235
/**
3336
* A base class for resource mapping.
3437
*
@@ -38,6 +41,11 @@ public class Resource {
3841

3942
private static final RdfService service = ServiceProvider.getRdfService();
4043

44+
/**
45+
* The RDF Factory instance.
46+
*/
47+
protected static final RDF rdf = RDFFactory.getInstance();
48+
4149
private final Dataset dataset;
4250
private final URI identifier;
4351

@@ -51,7 +59,7 @@ public class Resource {
5159
*/
5260
protected Resource(final URI identifier, final Dataset dataset) {
5361
this.identifier = identifier;
54-
this.dataset = dataset != null ? dataset : service.createDataset();
62+
this.dataset = dataset != null ? dataset : rdf.createDataset();
5563
}
5664

5765
/**
@@ -79,7 +87,7 @@ public Dataset getDataset() {
7987
* @param out the output stream
8088
* @throws IOException in the case of an I/O error
8189
*/
82-
public void serialize(final Syntax syntax, final OutputStream out) throws IOException {
90+
public void serialize(final RDFSyntax syntax, final OutputStream out) throws IOException {
8391
service.fromDataset(getDataset(), syntax, out);
8492
}
8593

api/src/main/java/com/inrupt/client/rdf/Dataset.java

Lines changed: 0 additions & 78 deletions
This file was deleted.

api/src/main/java/com/inrupt/client/rdf/Graph.java

Lines changed: 0 additions & 75 deletions
This file was deleted.

api/src/main/java/com/inrupt/client/rdf/RDFFactory.java

Lines changed: 0 additions & 93 deletions
This file was deleted.

0 commit comments

Comments
 (0)