@@ -7,14 +7,17 @@ import org.scalatest._
7
7
8
8
class ResultShapeMapTest extends FunSpec with Matchers with TryValues with OptionValues {
9
9
10
- describe(" ResultShapeMaps" ) {
10
+ /* describe("ResultShapeMaps") {
11
11
val rdfStr =
12
12
"""prefix : <http://example.org/>
13
13
|:a :b :c .
14
14
""".stripMargin
15
+
15
16
compareResultMaps(":a@:S", ":a@:S", rdfStr, true)
16
17
compareResultMaps(":a@:S", ":b@:S", rdfStr, false)
17
18
compareResultMaps(":a@:S", ":a@:S,:b@:S", rdfStr, false)
19
+ compareResultMaps(":a@!:S", ":a@!:S", rdfStr, true)
20
+
18
21
}
19
22
20
23
def compareResultMaps(strMap1: String, strMap2: String, rdfStr: String, expectedEqual: Boolean): Unit = {
@@ -39,8 +42,33 @@ class ResultShapeMapTest extends FunSpec with Matchers with TryValues with Optio
39
42
})
40
43
}
41
44
}
45
+ */
46
+ describe(s " Parse result shape map " ) {
47
+ it(s " Should parse result shape map " ) {
48
+ val rdfStr =
49
+ """ |prefix : <http://example.org/>
50
+ |:x :p 1 .
51
+ """ .stripMargin
42
52
43
- describe(s " Get conformant shapes " ) {
53
+ val result = for {
54
+ rdf <- RDFAsJenaModel .fromChars(rdfStr," TURTLE" ,None )
55
+ resultMap <- ShapeMap .parseResultMap(" :x@!:S" , None , rdf, rdf.getPrefixMap)
56
+ } yield (rdf,resultMap)
57
+
58
+ result match {
59
+ case Left (err) => fail(s " Error: $err" )
60
+ case Right ((rdf,result)) => {
61
+ val x = IRI (" http://example.org/x" )
62
+ val s = IRILabel (IRI (" http://example.org/S" ))
63
+ val r : ResultShapeMap = ResultShapeMap (Map (x -> Map (s -> Info (NonConformant , None , None ))), rdf.getPrefixMap, rdf.getPrefixMap)
64
+ println(s " Result: $result\n r= $r" )
65
+ result should be(r)
66
+ }
67
+ }
68
+ }
69
+ }
70
+
71
+ /* describe(s"Get conformant shapes") {
44
72
val pm = PrefixMap.empty.addPrefix("",IRI("http://example.org/"))
45
73
val x: RDFNode = IRI("http://example.org/x")
46
74
val y: RDFNode = IRI("http://example.org/y")
@@ -82,5 +110,5 @@ class ResultShapeMapTest extends FunSpec with Matchers with TryValues with Optio
82
110
rm.getInfo(z,t).status should be(NonConformant)
83
111
rm.getInfo(z,u).status should be(Undefined)
84
112
}
85
- }
113
+ } */
86
114
}
0 commit comments