You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@clerezza.apache.org by bb...@apache.org on 2011/06/23 20:55:18 UTC
svn commit: r1139035 - in /incubator/clerezza/trunk/parent:
platform.security.foafssl/test/src/main/scala/org/apache/clerezza/foafssl/test/
rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/
rdf.scala.utils/src/test/scala/org/apache/cl...
Author: bblfish
Date: Thu Jun 23 18:55:18 2011
New Revision: 1139035
URL: http://svn.apache.org/viewvc?rev=1139035&view=rev
Log:
CLEREZZA-510 changes to get foafssl test packages working again. There is duplication of transformation methods in Preamble and in EasyGraph which lead to clashes
Modified:
incubator/clerezza/trunk/parent/platform.security.foafssl/test/src/main/scala/org/apache/clerezza/foafssl/test/WebIDTester.scala
incubator/clerezza/trunk/parent/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/Preamble.scala
incubator/clerezza/trunk/parent/rdf.scala.utils/src/test/scala/org/apache/clerezza/rdf/scala/utils/EasyGraphTest.scala
Modified: incubator/clerezza/trunk/parent/platform.security.foafssl/test/src/main/scala/org/apache/clerezza/foafssl/test/WebIDTester.scala
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/parent/platform.security.foafssl/test/src/main/scala/org/apache/clerezza/foafssl/test/WebIDTester.scala?rev=1139035&r1=1139034&r2=1139035&view=diff
==============================================================================
--- incubator/clerezza/trunk/parent/platform.security.foafssl/test/src/main/scala/org/apache/clerezza/foafssl/test/WebIDTester.scala (original)
+++ incubator/clerezza/trunk/parent/platform.security.foafssl/test/src/main/scala/org/apache/clerezza/foafssl/test/WebIDTester.scala Thu Jun 23 18:55:18 2011
@@ -33,7 +33,7 @@ import impl.{PlainLiteralImpl, TypedLite
import org.apache.clerezza.foafssl.ontologies._
import org.apache.clerezza.foafssl.auth.{WebIDClaim, Verification, WebIdPrincipal, X509Claim}
import java.util.Date
-import org.apache.clerezza.rdf.scala.utils.Preamble._
+import org.apache.clerezza.rdf.scala.utils.Preamble.{toRichGraphNode,toFirstElement}
import org.apache.clerezza.rdf.scala.utils.{CollectedIter, EasyGraphNode, EasyGraph, RichGraphNode}
import serializedform.Serializer
import java.io.ByteArrayOutputStream
@@ -131,7 +131,7 @@ class CertTester(subj: Subject, webIdGra
def runTests() {
val thisDoc = (g.bnode â FOAF.Document //there really has to be a way to get THIS doc url, to add relative urls to the graph
- â DCTERMS.created ⶠnow
+ â DCTERMS.created ⶠnow
)
//
// Description of certificates and their public profileKeys
@@ -601,7 +601,7 @@ class CertTester(subj: Subject, webIdGra
sout.serialize(out, graph, "text/rdf+n3")
val n3String = out.toString("UTF-8")
//todo: turtle mime type literal?
- val keylit = g.bnode â OWL.sameAs ⶠ(n3String ^^ new UriRef("http://example.com/turtle"))
+ val keylit: EasyGraphNode = g.bnode â OWL.sameAs ⶠ(n3String^^"http://example.com/turtle".uri)
//
@@ -693,7 +693,7 @@ class Assertor {
for (test <- assertions) {
test.toRdf()
}
- g.graph
+ g
}
class Assertion(testName: UriRef,
Modified: incubator/clerezza/trunk/parent/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/Preamble.scala
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/parent/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/Preamble.scala?rev=1139035&r1=1139034&r2=1139035&view=diff
==============================================================================
--- incubator/clerezza/trunk/parent/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/Preamble.scala (original)
+++ incubator/clerezza/trunk/parent/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/Preamble.scala Thu Jun 23 18:55:18 2011
@@ -119,39 +119,6 @@ protected object TcIndependentConversion
val emptyGraph = new impl.SimpleGraph(new impl.SimpleMGraph)
val emptyLiteral = new RichGraphNode(new GraphNode(new impl.PlainLiteralImpl(""), emptyGraph))
- /**
- * A Literal Builder enriches a String with methods to create a literal
- */
- class LiteralBuilder(val lexicalForm: String) {
-
- /**
- * Produces a PlainLiteral with the wrapped String as lexical form
- * and a given language
- *
- * @param lang the language tag of the literal to be created
- * @return a plain literal with the specified language
- */
- def lang(lang: Lang) = new PlainLiteralImpl(lexicalForm, lang)
-
- /**
- * Produces a PlainLiteral with the wrapped String as lexical form
- * and a given language
- *
- * @param lang a symbol of which the name is the language tag of the literal to be created
- * @return a plain literal with the specified language
- */
- def lang(lang: Symbol) = new PlainLiteralImpl(lexicalForm, new Language(lang.name))
-
- /**
- * Produces a TypedLiteral with the wrapped String as lexical form
- * and a data type
- *
- * @param dataType the data type
- * @return the TypedLiteral of the specified type
- */
- def ^^(dataType: UriRef) = new TypedLiteralImpl(lexicalForm, dataType)
-
- }
/**
* A UriRef Builder enriches a String with methods to create a UriRef
Modified: incubator/clerezza/trunk/parent/rdf.scala.utils/src/test/scala/org/apache/clerezza/rdf/scala/utils/EasyGraphTest.scala
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/parent/rdf.scala.utils/src/test/scala/org/apache/clerezza/rdf/scala/utils/EasyGraphTest.scala?rev=1139035&r1=1139034&r2=1139035&view=diff
==============================================================================
--- incubator/clerezza/trunk/parent/rdf.scala.utils/src/test/scala/org/apache/clerezza/rdf/scala/utils/EasyGraphTest.scala (original)
+++ incubator/clerezza/trunk/parent/rdf.scala.utils/src/test/scala/org/apache/clerezza/rdf/scala/utils/EasyGraphTest.scala Thu Jun 23 18:55:18 2011
@@ -18,11 +18,10 @@
*/
package org.apache.clerezza.rdf.scala.utils
-import org.apache.clerezza.rdf.utils._
import org.apache.clerezza.rdf.ontologies._
import org.junit._
import org.apache.clerezza.rdf.core._
-import impl.{TypedLiteralImpl, PlainLiteralImpl, SimpleMGraph, TripleImpl}
+import impl._
class EasyGraphTest {
@@ -138,8 +137,6 @@ class EasyGraphTest {
val ez = new EasyGraph()
import org.apache.clerezza.rdf.scala.utils.EasyGraph._
- import org.apache.clerezza.rdf.scala.utils.Lang._
-
(ez.u(retoUri) -- FOAF.knows -->> List(henryUri.uri,danbriUri.uri))
Assert.assertEquals("the two graphs should be of same size",gr.size(),ez.size())
@@ -176,8 +173,6 @@ class EasyGraphTest {
@Test
def uriEquals {
import org.apache.clerezza.rdf.scala.utils.EasyGraph._
- import org.apache.clerezza.rdf.scala.utils.Lang._
-
val uc = new UriRef("http://clerezza.org/")
val ec = "http://clerezza.org/".uri
@@ -188,13 +183,32 @@ class EasyGraphTest {
}
@Test
- def literalEquals {
- val exp = LiteralFactory.getInstance().createTypedLiteral(65537)
- val mod= new TypedLiteralImpl(bblfishModulus,hex)
+ def literalTester1 {
+ val n3 = """
+ @prefix foaf: <http://xmlns.com/foaf/0.1/> .
+ <http://bblfish.net/#hjs> a foaf:Person .
+ """
+ val n3Lit : Literal = new TypedLiteralImpl(n3,new UriRef("http://example.com/turtle"))
+ val gr = new SimpleMGraph
+ gr.add(new TripleImpl(new BNode,OWL.sameAs,n3Lit))
import org.apache.clerezza.rdf.scala.utils.EasyGraph._
import org.apache.clerezza.rdf.scala.utils.Lang._
+ val ez = new EasyGraph()
+
+ val res : EasyGraphNode = (ez.bnode â OWL.sameAs ⶠ(n3^^"http://example.com/turtle".uri))
+
+ Assert.assertEquals("the two graphs must be equal",gr.getGraph,ez.getGraph)
+
+ }
+
+ @Test
+ def literalTester2 {
+ val exp = LiteralFactory.getInstance().createTypedLiteral(65537)
+ val mod= new TypedLiteralImpl(bblfishModulus,hex)
+
+ import org.apache.clerezza.rdf.scala.utils.EasyGraph._
val modZ: TypedLiteral = bblfishModulus^^hex
val expZ: TypedLiteral = 65537