Skip to content

Commit

Permalink
compatibility with LIMES
Browse files Browse the repository at this point in the history
  • Loading branch information
mommi84 committed Feb 11, 2015
1 parent ff5a851 commit 9083a23
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion rocker-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>org.aksw.rocker</groupId>
<artifactId>rocker</artifactId>
<version>1.2.0-SNAPSHOT</version>
<version>1.2</version>
<packaging>jar</packaging>

<name>rocker-parent</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.apache.jena.riot.RiotException;
import org.apache.log4j.Logger;

import com.hp.hpl.jena.rdf.model.Literal;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.Property;
Expand Down Expand Up @@ -53,7 +54,7 @@ public static RKDClassTask index(final String filename, SQLiteManager sql, Strin

int errors = 0;
try {
m.read(filename);
m.read(filename, null, "N-TRIPLES");
} catch (RiotException e) {
errors++;
}
Expand Down Expand Up @@ -161,7 +162,7 @@ private static String toIdentifier(RDFNode o) {
+ "blanknode/BN" + DigestUtils.shaHex(o.toString())
: ((Resource) o).getURI();
else
return o.asLiteral().getString();
return o.as(Literal.class).getString();
}

private static void print(String s) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ public static HashMap<String, List<Resource>> loadClassList(String path) {
while(statIt.hasNext()) {
Statement s = statIt.next();
Resource dataset = s.getSubject();
String graph = s.getObject().asResource().getURI();
String graph = s.getObject().as(Resource.class).getURI();
// get all classes for each graph
ArrayList<Resource> classes = new ArrayList<>();
Iterator<RDFNode> nodeIt = model.listObjectsOfProperty(dataset, ResourceFactory.createProperty("http://aksw.org/deduplication/requiredClasses"));
while(nodeIt.hasNext()) {
Resource c = nodeIt.next().asResource();
Resource c = nodeIt.next().as(Resource.class);
classes.add(c);
}
res.put(graph, classes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private void computeJSONString() {
Model m = ModelFactory.createDefaultModel();

try {
m.read(inputFile);
m.read(inputFile, null, "N-TRIPLES");
} catch (RiotException e) {}


Expand Down

0 comments on commit 9083a23

Please sign in to comment.