Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
78 changed files
with
1,870 additions
and
542 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# This configuration file contains the settings for the assessment. | ||
rdf.qualityassessment.dataset.prefixes=["http://dbpedia.org/","http://ex.org/foo/"] | ||
|
||
rdf.qualityassessment.dataset.subject="http://commons.dbpedia.org/resource/Category:Events" | ||
rdf.qualityassessment.dataset.property="http://commons.dbpedia.org/property/author" | ||
|
||
rdf.qualityassessment.dataset.lowerBound=0 | ||
rdf.qualityassessment.dataset.upperBound=1 | ||
|
||
rdf.qualityassessment.dataset.shortUri.threshold = 95 |
2 changes: 1 addition & 1 deletion
2
...utils/kryo/jena/JenaKryoSerializers.scala → ...ommon/kryo/jena/JenaKryoSerializers.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ualityassessment/utils/DatasetUtils.scala → ...ualityassessment/utils/DatasetUtils.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../qualityassessment/vocabularies/DQV.scala → ...tyassessment/utils/vocabularies/DQV.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 10 additions & 30 deletions
40
...n/src/test/scala/net/sansa_stack/rdf/common/partition/core/RdfPartitionDefaultTests.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,31 @@ | ||
package net.sansa_stack.rdf.common.partition.core | ||
|
||
import net.sansa_stack.rdf.common.partition.schema.SchemaStringStringLang | ||
import org.apache.jena.graph.{ Node, NodeFactory, Triple } | ||
import org.scalatest.FunSuite | ||
|
||
import net.sansa_stack.rdf.common.partition.core.RdfPartitionerDefault._ | ||
import net.sansa_stack.rdf.common.partition.schema.{ SchemaStringString, SchemaStringStringLang } | ||
|
||
/** | ||
* @author Gezim Sejdiu | ||
*/ | ||
class RdfPartitionerDefaultTests extends FunSuite { | ||
class RdfPartitionDefaultTests extends FunSuite { | ||
|
||
val triple = Triple.create( | ||
NodeFactory.createURI("http://dbpedia.org/resource/Guy_de_Maupassant"), | ||
NodeFactory.createURI("http://xmlns.com/foaf/0.1/givenName"), | ||
NodeFactory.createLiteral("Guy De")) | ||
|
||
test("getting URI or BNode string should match") { | ||
val node = NodeFactory.createURI("http://dbpedia.org/resource/Guy_de_Maupassant") | ||
assert(getUriOrBNodeString(triple.getSubject).matches(node.getURI)) | ||
} | ||
|
||
test("getting RDF Term type should match") { | ||
assert(getRdfTermType(triple.getSubject) == 1) | ||
} | ||
|
||
test("chechking if data type is PlainLiteral should match") { | ||
assert(isPlainLiteralDatatype(triple.getObject.getLiteralDatatypeURI)) | ||
} | ||
val partition = new RdfPartitionDefault(1, "http://xmlns.com/foaf/0.1/givenName", | ||
2, "http://www.w3.org/2001/XMLSchema#string", true) | ||
|
||
test("chechking if [[Node]] is TypedLiteral should match") { | ||
assert(!isTypedLiteral(triple.getObject)) | ||
} | ||
|
||
test("getting partitioning layout from [[Triple]] should match") { | ||
val expectedPartition = new RdfPartitionDefault(1, "http://xmlns.com/foaf/0.1/givenName", | ||
2, "http://www.w3.org/2001/XMLSchema#string", true) | ||
assert(fromTriple(triple).equals(expectedPartition)) | ||
} | ||
|
||
test("determining Layout should match") { | ||
test("getting layout should match") { | ||
val expectedLayout = new SchemaStringStringLang("http://dbpedia.org/resource/Guy_de_Maupassant", "Guy De", "") | ||
assert(determineLayout(fromTriple(triple)).fromTriple(triple).equals(expectedLayout)) | ||
assert(partition.layout.fromTriple(triple).equals(expectedLayout)) | ||
} | ||
|
||
test("determining Layout Datatype should match") { | ||
val expectedLayoutDatatype = new SchemaStringString("http://dbpedia.org/resource/Guy_de_Maupassant", "Guy De") | ||
assert(determineLayoutDatatype(triple.getObject.getLiteralDatatypeURI).fromTriple(triple).equals(expectedLayoutDatatype)) | ||
test("getting partition layout should match") { | ||
val expectedLayout = partition.matches(triple) | ||
assert(partition.matches(triple).equals(expectedLayout)) | ||
} | ||
|
||
} |
51 changes: 51 additions & 0 deletions
51
...src/test/scala/net/sansa_stack/rdf/common/partition/core/RdfPartitionerDefaultTests.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package net.sansa_stack.rdf.common.partition.core | ||
|
||
import net.sansa_stack.rdf.common.partition.core.RdfPartitionerDefault._ | ||
import net.sansa_stack.rdf.common.partition.schema.{ SchemaStringString, SchemaStringStringLang } | ||
import org.apache.jena.graph.{ Node, NodeFactory, Triple } | ||
import org.scalatest.FunSuite | ||
|
||
|
||
/** | ||
* @author Gezim Sejdiu | ||
*/ | ||
class RdfPartitionerDefaultTests extends FunSuite { | ||
|
||
val triple = Triple.create( | ||
NodeFactory.createURI("http://dbpedia.org/resource/Guy_de_Maupassant"), | ||
NodeFactory.createURI("http://xmlns.com/foaf/0.1/givenName"), | ||
NodeFactory.createLiteral("Guy De")) | ||
|
||
test("getting URI or BNode string should match") { | ||
val node = NodeFactory.createURI("http://dbpedia.org/resource/Guy_de_Maupassant") | ||
assert(getUriOrBNodeString(triple.getSubject).matches(node.getURI)) | ||
} | ||
|
||
test("getting RDF Term type should match") { | ||
assert(getRdfTermType(triple.getSubject) == 1) | ||
} | ||
|
||
test("chechking if data type is PlainLiteral should match") { | ||
assert(isPlainLiteralDatatype(triple.getObject.getLiteralDatatypeURI)) | ||
} | ||
|
||
test("chechking if [[Node]] is TypedLiteral should match") { | ||
assert(!isTypedLiteral(triple.getObject)) | ||
} | ||
|
||
test("getting partitioning layout from [[Triple]] should match") { | ||
val expectedPartition = new RdfPartitionDefault(1, "http://xmlns.com/foaf/0.1/givenName", | ||
2, "http://www.w3.org/2001/XMLSchema#string", true) | ||
assert(fromTriple(triple).equals(expectedPartition)) | ||
} | ||
|
||
test("determining Layout should match") { | ||
val expectedLayout = new SchemaStringStringLang("http://dbpedia.org/resource/Guy_de_Maupassant", "Guy De", "") | ||
assert(determineLayout(fromTriple(triple)).fromTriple(triple).equals(expectedLayout)) | ||
} | ||
|
||
test("determining Layout Datatype should match") { | ||
val expectedLayoutDatatype = new SchemaStringString("http://dbpedia.org/resource/Guy_de_Maupassant", "Guy De") | ||
assert(determineLayoutDatatype(triple.getObject.getLiteralDatatypeURI).fromTriple(triple).equals(expectedLayoutDatatype)) | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
.../src/test/scala/net/sansa_stack/rdf/common/partition/layout/TripleLayoutDoubleTests.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package net.sansa_stack.rdf.common.partition.layout | ||
|
||
import net.sansa_stack.rdf.common.partition.layout.TripleLayoutDouble._ | ||
import net.sansa_stack.rdf.common.partition.schema.SchemaStringDouble | ||
import org.apache.jena.datatypes.xsd.XSDDatatype | ||
import org.apache.jena.graph.{ Node, NodeFactory, Triple } | ||
import org.scalatest.FunSuite | ||
|
||
|
||
/** | ||
* @author Gezim Sejdiu | ||
*/ | ||
class TripleLayoutDoubleTests extends FunSuite { | ||
|
||
val triple = Triple.create( | ||
NodeFactory.createURI("http://dbpedia.org/resource/Germany"), | ||
NodeFactory.createURI("http://dbpedia.org/ontology/populationTotal"), | ||
NodeFactory.createLiteral("82175700", XSDDatatype.XSDdouble)) | ||
|
||
test("getting layout from triple should match") { | ||
val expectedLayout = new SchemaStringDouble(triple.getSubject.getURI, triple.getObject.getLiteralValue.toString().toDouble) | ||
assert(fromTriple(triple).equals(expectedLayout)) | ||
} | ||
|
||
} |
24 changes: 24 additions & 0 deletions
24
...on/src/test/scala/net/sansa_stack/rdf/common/partition/layout/TripleLayoutLongTests.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package net.sansa_stack.rdf.common.partition.layout | ||
|
||
import net.sansa_stack.rdf.common.partition.layout.TripleLayoutLong._ | ||
import net.sansa_stack.rdf.common.partition.schema.SchemaStringLong | ||
import org.apache.jena.datatypes.xsd.XSDDatatype | ||
import org.apache.jena.graph.{ Node, NodeFactory, Triple } | ||
import org.scalatest.FunSuite | ||
|
||
/** | ||
* @author Gezim Sejdiu | ||
*/ | ||
class TripleLayoutLongTests extends FunSuite { | ||
|
||
val triple = Triple.create( | ||
NodeFactory.createURI("http://dbpedia.org/resource/Germany"), | ||
NodeFactory.createURI("http://dbpedia.org/ontology/populationTotal"), | ||
NodeFactory.createLiteral("82175700", XSDDatatype.XSDlong)) | ||
|
||
test("getting layout from triple should match") { | ||
val expectedLayout = new SchemaStringLong(triple.getSubject.getURI, triple.getObject.getLiteralValue.toString().toLong) | ||
assert(fromTriple(triple).equals(expectedLayout)) | ||
} | ||
|
||
} |
24 changes: 24 additions & 0 deletions
24
...t/scala/net/sansa_stack/rdf/common/partition/layout/TripleLayoutStringDatatypeTests.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package net.sansa_stack.rdf.common.partition.layout | ||
|
||
import net.sansa_stack.rdf.common.partition.layout.TripleLayoutStringDatatype._ | ||
import net.sansa_stack.rdf.common.partition.schema.SchemaStringStringType | ||
import org.apache.jena.datatypes.xsd.XSDDatatype | ||
import org.apache.jena.graph.{ Node, NodeFactory, Triple } | ||
import org.scalatest.FunSuite | ||
|
||
/** | ||
* @author Gezim Sejdiu | ||
*/ | ||
class TripleLayoutStringDatatypeTests extends FunSuite { | ||
|
||
val triple = Triple.create( | ||
NodeFactory.createURI("http://dbpedia.org/resource/Germany"), | ||
NodeFactory.createURI("http://dbpedia.org/ontology/populationTotal"), | ||
NodeFactory.createLiteral("82175700", XSDDatatype.XSDlong)) | ||
|
||
test("getting layout from triple should match") { | ||
val expectedLayout = new SchemaStringStringType(triple.getSubject.getURI, triple.getObject.getLiteralLexicalForm, triple.getObject.getLiteralDatatype.getURI) | ||
assert(fromTriple(triple).equals(expectedLayout)) | ||
} | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
.../test/scala/net/sansa_stack/rdf/common/partition/layout/TripleLayoutStringLangTests.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package net.sansa_stack.rdf.common.partition.layout | ||
|
||
import net.sansa_stack.rdf.common.partition.layout.TripleLayoutStringLang._ | ||
import net.sansa_stack.rdf.common.partition.schema.SchemaStringStringLang | ||
import org.apache.commons.codec.language.bm.Lang | ||
import org.apache.jena.datatypes.xsd.XSDDatatype | ||
import org.apache.jena.graph.{ Node, NodeFactory, Triple } | ||
import org.scalatest.FunSuite | ||
|
||
/** | ||
* @author Gezim Sejdiu | ||
*/ | ||
class TripleLayoutStringLangTests extends FunSuite { | ||
|
||
val triple = Triple.create( | ||
NodeFactory.createURI("http://dbpedia.org/resource/Germany"), | ||
NodeFactory.createURI("http://dbpedia.org/ontology/populationTotal"), | ||
NodeFactory.createLiteral("82175700", "en", XSDDatatype.XSDdouble)) | ||
|
||
test("getting layout from triple should match") { | ||
val expectedLayout = new SchemaStringStringLang(triple.getSubject.getURI, triple.getObject.getLiteralLexicalForm, triple.getObject.getLiteralLanguage) | ||
assert(fromTriple(triple).equals(expectedLayout)) | ||
} | ||
|
||
} |
24 changes: 24 additions & 0 deletions
24
.../src/test/scala/net/sansa_stack/rdf/common/partition/layout/TripleLayoutStringTests.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package net.sansa_stack.rdf.common.partition.layout | ||
|
||
import net.sansa_stack.rdf.common.partition.layout.TripleLayoutString._ | ||
import net.sansa_stack.rdf.common.partition.schema.SchemaStringString | ||
import org.apache.jena.datatypes.xsd.XSDDatatype | ||
import org.apache.jena.graph.{ Node, NodeFactory, Triple } | ||
import org.scalatest.FunSuite | ||
|
||
/** | ||
* @author Gezim Sejdiu | ||
*/ | ||
class TripleLayoutStringTests extends FunSuite { | ||
|
||
val triple = Triple.create( | ||
NodeFactory.createURI("http://dbpedia.org/resource/Germany"), | ||
NodeFactory.createURI("http://dbpedia.org/ontology/populationTotal"), | ||
NodeFactory.createLiteral("82175700", XSDDatatype.XSDinteger)) | ||
|
||
test("getting layout from triple should match") { | ||
val expectedLayout = new SchemaStringString(triple.getSubject.getURI, triple.getObject.getLiteralLexicalForm) | ||
assert(fromTriple(triple).equals(expectedLayout)) | ||
} | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
...est/scala/net/sansa_stack/rdf/common/partition/model/sparqlify/SparqlifyUtils2Tests.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package net.sansa_stack.rdf.common.partition.model.sparqlify | ||
|
||
import net.sansa_stack.rdf.common.partition.core.RdfPartitionerDefault | ||
import net.sansa_stack.rdf.common.partition.model.sparqlify.SparqlifyUtils2._ | ||
import org.aksw.obda.jena.domain.impl.ViewDefinition | ||
import org.apache.jena.graph.{ Node, NodeFactory, Triple } | ||
import org.scalatest.FunSuite | ||
|
||
/** | ||
* @author Gezim Sejdiu | ||
*/ | ||
class SparqlifyUtils2Tests extends FunSuite { | ||
|
||
val triple = Triple.create( | ||
NodeFactory.createURI("http://dbpedia.org/resource/Germany"), | ||
NodeFactory.createURI("http://dbpedia.org/ontology/populationTotal"), | ||
NodeFactory.createLiteral("82175700")) | ||
|
||
test("creating view definition should pass") { | ||
val partitioner = RdfPartitionerDefault.fromTriple(triple) | ||
val viewDefinition = createViewDefinition(partitioner) | ||
val expectedViewDefinition = new ViewDefinition(viewDefinition.getName, viewDefinition.getConstructTemplate, viewDefinition.getVarDefinition, viewDefinition.getConstraints, viewDefinition.getLogicalTable) | ||
assert(createViewDefinition(partitioner).equals(expectedViewDefinition)) | ||
} | ||
|
||
} |
27 changes: 27 additions & 0 deletions
27
...a-rdf-common/src/test/scala/net/sansa_stack/rdf/common/partition/utils/RdfTermTests.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package net.sansa_stack.rdf.common.partition.utils | ||
|
||
import net.sansa_stack.rdf.common.partition.utils.RdfTerm._ | ||
import org.apache.jena.graph.{ Node, NodeFactory, Triple } | ||
import org.scalatest.FunSuite | ||
|
||
/** | ||
* @author Gezim Sejdiu | ||
*/ | ||
class RdfTermTests extends FunSuite { | ||
|
||
val triple = Triple.create( | ||
NodeFactory.createURI("http://dbpedia.org/resource/Germany"), | ||
NodeFactory.createURI("http://dbpedia.org/ontology/populationTotal"), | ||
NodeFactory.createLiteral("82175700")) | ||
|
||
test("converting rdf term to node should pass") { | ||
val term = nodeToTerm(triple.getSubject) | ||
assert(termToNode(term).equals(triple.getSubject)) | ||
} | ||
|
||
test("converting node to rdf term should pass") { | ||
val requiredRDFTerm = new RdfTerm(1, "http://dbpedia.org/resource/Germany", null, null) | ||
assert(nodeToTerm(triple.getSubject).equals(requiredRDFTerm)) | ||
} | ||
|
||
} |
Oops, something went wrong.