From 26b99aac0d44ebfe60665479950d500ac1f4f6a3 Mon Sep 17 00:00:00 2001 From: Dimitris Kontokostas Date: Sat, 26 Sep 2015 11:04:26 +0100 Subject: [PATCH] LOV dependency #34 #39 --- .../org/aksw/rdfunit/{utils => prefix}/LOVEntry.java | 2 +- .../org/aksw/rdfunit/{utils => prefix}/LOVUtils.java | 10 +++++----- .../main/java/org/aksw/rdfunit/utils/RDFUnitUtils.java | 2 ++ 3 files changed, 8 insertions(+), 6 deletions(-) rename rdfunit-core/src/main/java/org/aksw/rdfunit/{utils => prefix}/LOVEntry.java (98%) rename rdfunit-core/src/main/java/org/aksw/rdfunit/{utils => prefix}/LOVUtils.java (89%) diff --git a/rdfunit-core/src/main/java/org/aksw/rdfunit/utils/LOVEntry.java b/rdfunit-core/src/main/java/org/aksw/rdfunit/prefix/LOVEntry.java similarity index 98% rename from rdfunit-core/src/main/java/org/aksw/rdfunit/utils/LOVEntry.java rename to rdfunit-core/src/main/java/org/aksw/rdfunit/prefix/LOVEntry.java index caaa4bf2a..d315e447c 100644 --- a/rdfunit-core/src/main/java/org/aksw/rdfunit/utils/LOVEntry.java +++ b/rdfunit-core/src/main/java/org/aksw/rdfunit/prefix/LOVEntry.java @@ -1,4 +1,4 @@ -package org.aksw.rdfunit.utils; +package org.aksw.rdfunit.prefix; /** * Encapsulates an LOV Entry diff --git a/rdfunit-core/src/main/java/org/aksw/rdfunit/utils/LOVUtils.java b/rdfunit-core/src/main/java/org/aksw/rdfunit/prefix/LOVUtils.java similarity index 89% rename from rdfunit-core/src/main/java/org/aksw/rdfunit/utils/LOVUtils.java rename to rdfunit-core/src/main/java/org/aksw/rdfunit/prefix/LOVUtils.java index 38b6cc665..41d4f3142 100644 --- a/rdfunit-core/src/main/java/org/aksw/rdfunit/utils/LOVUtils.java +++ b/rdfunit-core/src/main/java/org/aksw/rdfunit/prefix/LOVUtils.java @@ -1,4 +1,4 @@ -package org.aksw.rdfunit.utils; +package org.aksw.rdfunit.prefix; import com.hp.hpl.jena.query.QueryExecution; import com.hp.hpl.jena.query.QuerySolution; @@ -59,16 +59,16 @@ public static List getAllLOVEntries() { while (rs.hasNext()) { QuerySolution row = rs.next(); - String prefix = row.get("vocabPrefix").toString(); - String vocab = row.get("vocabURI").toString(); - String ns = row.get("vocabNamespace").toString(); + String prefix = row.get("vocabPrefix").asLiteral().getLexicalForm(); + String vocab = row.get("vocabURI").asLiteral().getLexicalForm(); + String ns = row.get("vocabNamespace").asLiteral().getLexicalForm(); String definedBy = ns; // default if (ns == null || ns.isEmpty()) { ns = vocab; } if (row.get("definedBy") != null) { - definedBy = row.get("definedBy").toString(); + definedBy = row.get("definedBy").asLiteral().getLexicalForm(); } lovEntries.add(new LOVEntry(prefix, vocab, ns, definedBy)); } diff --git a/rdfunit-core/src/main/java/org/aksw/rdfunit/utils/RDFUnitUtils.java b/rdfunit-core/src/main/java/org/aksw/rdfunit/utils/RDFUnitUtils.java index 50a7ff65b..3a141d054 100644 --- a/rdfunit-core/src/main/java/org/aksw/rdfunit/utils/RDFUnitUtils.java +++ b/rdfunit-core/src/main/java/org/aksw/rdfunit/utils/RDFUnitUtils.java @@ -1,5 +1,7 @@ package org.aksw.rdfunit.utils; +import org.aksw.rdfunit.prefix.LOVEntry; +import org.aksw.rdfunit.prefix.LOVUtils; import org.aksw.rdfunit.services.SchemaService; import org.slf4j.Logger; import org.slf4j.LoggerFactory;