Author: bblfish
Date: Thu Jun 30 14:31:52 2011
New Revision: 1141551
URL: http://svn.apache.org/viewvc?rev=1141551&view=rev
Log:
CLEREZZA-510 made the ascii arrow notation for EzGraph the default.
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/EzGraph.scala
incubator/clerezza/trunk/parent/rdf.scala.utils/src/test/scala/org/apache/clerezza/rdf/scala/utils/EzGraphTest.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=1141551&r1=1141550&r2=1141551&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 30 14:31:52 2011
@@ -43,6 +43,7 @@ import javax.security.auth.Subject
import collection.JavaConversions._
import org.apache.clerezza.platform.users.WebIdGraphsService
import org.apache.clerezza.rdf.scala.utils._
+import EzStyleChoice.unicode
/**
@@ -122,7 +123,6 @@ class WebIDTester {
class CertTester(subj: Subject, webIdGraphsService: WebIdGraphsService)
extends Assertor {
import EARL.{passed, failed, cantTell, untested, inapplicable}
- import EzStyleChoice.unicode
val creds: scala.collection.mutable.Set[X509Claim] =
subj.getPublicCredentials(classOf[X509Claim]);
val now = new Date()
@@ -699,7 +699,6 @@ class Assertor {
class Assertion(testName: UriRef,
subjects: Seq[Resource]) {
-
//only add this runTests to the list of assertions if there is
a result
//this makes it easier to write code that keeps track of
assertions, without ending up having to
//publish all of them
Modified:
incubator/clerezza/trunk/parent/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/EzGraph.scala
URL:
http://svn.apache.org/viewvc/incubator/clerezza/trunk/parent/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/EzGraph.scala?rev=1141551&r1=1141550&r2=1141551&view=diff
==============================================================================
---
incubator/clerezza/trunk/parent/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/EzGraph.scala
(original)
+++
incubator/clerezza/trunk/parent/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/EzGraph.scala
Thu Jun 30 14:31:52 2011
@@ -127,7 +127,7 @@ object EzStyleChoice {
implicit val unicode = new EzStyle[EzGraphNodeU](){
override def preferred(ref: NonLiteral, tc: TripleCollection):
EzGraphNodeU = new EzGraphNodeU(ref,tc)
}
- implicit val ascii = new EzStyle[EzGraphNodeA](){
+ implicit val arrow = new EzStyle[EzGraphNodeA](){
override def preferred(ref: NonLiteral, tc: TripleCollection):
EzGraphNodeA = new EzGraphNodeA(ref,tc)
}
implicit val english = new EzStyle[EzGraphNodeEn](){
@@ -159,7 +159,7 @@ class EzGraph(val graph: TripleCollectio
/**
* create a new bnode based EzGraphNode with the preferred writing style
*/
- def bnode[T<: EzGraphNode](implicit writingStyle:
EzStyle[T]=EzStyleChoice.unicode ): T = {
+ def bnode[T<: EzGraphNode](implicit writingStyle:
EzStyle[T]=EzStyleChoice.arrow ): T = {
node(new BNode)(writingStyle)
}
@@ -168,7 +168,7 @@ class EzGraph(val graph: TripleCollectio
/**
* create a new named bnode based EzGraphNode with the preferred
writing style
*/
- def b_[T<: EzGraphNode](name: String)(implicit writingStyle:
EzStyle[T]=EzStyleChoice.unicode): T = {
+ def b_[T<: EzGraphNode](name: String)(implicit writingStyle:
EzStyle[T]=EzStyleChoice.arrow): T = {
namedBnodes.get(name) match {
case Some(bnode) => writingStyle.preferred(bnode,graph)
case None => {
@@ -182,7 +182,7 @@ class EzGraph(val graph: TripleCollectio
/**
* create a new url based EzGraphNode with the preferred writing style
*/
- def u[T<: EzGraphNode](url: String)(implicit writingStyle:
EzStyle[T]=EzStyleChoice.unicode): T = {
+ def u[T<: EzGraphNode](url: String)(implicit writingStyle:
EzStyle[T]=EzStyleChoice.arrow): T = {
node(new UriRef(url))(writingStyle)
}
@@ -190,7 +190,7 @@ class EzGraph(val graph: TripleCollectio
* create a new Resource based EzGraphNode with the preferred writing
style.
* The EzGraphNode will contain the graph that this EzGraph is built on
and point to the given subj
*/
- def node[T<: EzGraphNode](subj: NonLiteral)(implicit writingStyle:
EzStyle[T]=EzStyleChoice.unicode ): T = {
+ def node[T<: EzGraphNode](subj: NonLiteral)(implicit writingStyle:
EzStyle[T]=EzStyleChoice.arrow ): T = {
writingStyle.preferred(subj,graph)
}
@@ -508,7 +508,7 @@ object EzGraphNode {
/**
* create a new EzGraphNode in the preferred writing style
*/
- def apply[T<:EzGraphNode](ref: NonLiteral, graph:
TripleCollection)(implicit writingStyle: EzStyle[T]=EzStyleChoice.unicode ): T
= {
+ def apply[T<:EzGraphNode](ref: NonLiteral, graph:
TripleCollection)(implicit writingStyle: EzStyle[T]=EzStyleChoice.arrow ): T = {
writingStyle.preferred(ref,graph)
}
}
Modified:
incubator/clerezza/trunk/parent/rdf.scala.utils/src/test/scala/org/apache/clerezza/rdf/scala/utils/EzGraphTest.scala
URL:
http://svn.apache.org/viewvc/incubator/clerezza/trunk/parent/rdf.scala.utils/src/test/scala/org/apache/clerezza/rdf/scala/utils/EzGraphTest.scala?rev=1141551&r1=1141550&r2=1141551&view=diff
==============================================================================
---
incubator/clerezza/trunk/parent/rdf.scala.utils/src/test/scala/org/apache/clerezza/rdf/scala/utils/EzGraphTest.scala
(original)
+++
incubator/clerezza/trunk/parent/rdf.scala.utils/src/test/scala/org/apache/clerezza/rdf/scala/utils/EzGraphTest.scala
Thu Jun 30 14:31:52 2011
@@ -87,6 +87,7 @@ class EzGraphTest {
val reto= new BNode()
gr.add(new TripleImpl(reto,RDF.`type`, FOAF.Person))
+ import EzStyleChoice.unicode
val ez = EzGraph()
ez.bnode â FOAF.Person
@@ -119,6 +120,7 @@ class EzGraphTest {
import org.apache.clerezza.rdf.scala.utils.EzGraph._
import org.apache.clerezza.rdf.scala.utils.Lang._
+ import org.apache.clerezza.rdf.scala.utils.EzStyleChoice.unicode
( ez.u(retoUri) â FOAF.Person
â todoRef â¶ List[Resource]("SPARQL update
support".lang(en),"XSPARQL support".lang(en),holiday.uri))
@@ -136,7 +138,8 @@ class EzGraphTest {
val ez = EzGraph()
import org.apache.clerezza.rdf.scala.utils.EzGraph._
- (ez.u(retoUri)(EzStyleChoice.ascii) -- FOAF.knows -->>
List(henryUri.uri,danbriUri.uri))
+ //default style is now arrow
+ (ez.u(retoUri) -- FOAF.knows -->>
List(henryUri.uri,danbriUri.uri))
Assert.assertEquals("the two graphs should be of same
size",gr.size(),ez.graph.size())
Assert.assertEquals("Both graphs should contain exactly the
same triples",gr.getGraph,new SimpleGraph(ez.graph)) //mutable graphs cannot be
compared for equality
@@ -191,11 +194,11 @@ class EzGraphTest {
val gr = new SimpleMGraph
gr.add(new TripleImpl(new BNode,OWL.sameAs,n3Lit))
- import org.apache.clerezza.rdf.scala.utils.EzGraph._
- import org.apache.clerezza.rdf.scala.utils.Lang._
+ import EzGraph._
+ import EzStyleChoice.unicode
val ez = EzGraph()
- val res : EzGraphNode = (ez.bnode â OWL.sameAs â¶
(n3^^"http://example.com/turtle".uri))
+ (ez.bnode â OWL.sameAs â¶
(n3^^"http://example.com/turtle".uri))
Assert.assertEquals("Both graphs should contain exactly the
same triples",gr.getGraph,new SimpleGraph(ez.graph)) //mutable graphs cannot be
compared for equality
@@ -259,7 +262,7 @@ class EzGraphTest {
def usingAsciiArrows {
import org.apache.clerezza.rdf.scala.utils.EzGraph._
import org.apache.clerezza.rdf.scala.utils.Lang._
- import EzStyleChoice.ascii
+ import EzStyleChoice.arrow
val ez = EzGraph()
// example using arrows
(