Skip to content

Commit a65e999

Browse files
committed
Test passes for issue 292
1 parent b85f537 commit a65e999

7 files changed

Lines changed: 17 additions & 36 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package es.weso.rdf
2+
3+
sealed abstract class RDFFormat {
4+
5+
}

modules/srdfJena/src/main/scala/es/weso/rdf/jena/JenaMapper.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,12 +208,12 @@ object JenaMapper {
208208
}
209209

210210
// I used org.apache.jena.vocabulary.RDF.dtRDFHTML but it seems to fail
211-
lazy val rdfHTML =
212-
new BaseDatatype("http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML")
211+
lazy val rdfHTML = "http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML"
213212

214213
// I used org.apache.jena.vocabulary.RDF.dtRDFXMLLiteral but it seems to fail
215-
lazy val rdfXML = new BaseDatatype("http://www.w3.org/1999/02/22-rdf-syntax-ns#XML")
216-
214+
// lazy val rdfXML = new BaseDatatype("http://www.w3.org/1999/02/22-rdf-syntax-ns#XML")
215+
lazy val rdfXML = "http://www.w3.org/1999/02/22-rdf-syntax-ns#XML"
216+
217217
def createRDFNode(m: JenaModel, node: RDFNode, base: Option[IRI]): JenaRDFNode = {
218218
val xsd = "http://www.w3.org/2001/XMLSchema#"
219219
val xsdinteger = xsd + "integer"

modules/srdfJena/src/test/scala/es/weso/rdftriple/jenaMapper/JenaMapperTest.scala

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ import cats._
99
import cats.implicits._
1010
import scala.jdk.CollectionConverters._
1111
import org.apache.jena.datatypes.RDFDatatype
12+
import org.apache.jena.datatypes.xsd.impl.RDFhtml
13+
import org.apache.jena.datatypes.BaseDatatype
14+
import java.io.InputStream
15+
import java.io.ByteArrayInputStream
1216

1317
class JenaMapperTest extends CatsEffectSuite with JenaBased {
1418

@@ -162,33 +166,5 @@ class JenaMapperTest extends CatsEffectSuite with JenaBased {
162166
assertEquals(checkIsomorphic(model1, model2), ().asRight)
163167
}
164168

165-
// Test added at issue: https://github.com/weso/srdf/issues/292
166-
test("Should compare one triple with a rdf:HTML literal".only) {
167-
val ts = Set(
168-
RDFTriple(
169-
IRI("http://example.org#a"),
170-
IRI("http://example.org#p"),
171-
RDFHTMLLiteral("<div>Test HTML markup</div>")))
172-
val s =
173-
"""|@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
174-
|<http://example.org#a> <http://example.org#p> "<div>Test HTML markup</div>"^^rdf:HTML .""".stripMargin
175-
println(s"ts: $ts")
176-
val empty = ModelFactory.createDefaultModel
177-
val model1 = RDFTriples2Model(ts, empty, None)
178-
val model2 = str2model(s)
179-
val s1 = model1.listSubjects().toList().asScala.head
180-
val s2 = model2.listSubjects().toList().asScala.head
181-
println(s"Subject1 = $s1, ${s1.getClass().getName()}")
182-
println(s"Subject2 = $s2, ${s2.getClass().getName()}")
183-
println(s"Are equal? ${s1.equals(s2)}")
184-
185-
val o1dt = model1.listObjects().toList().asScala.head.asLiteral().getDatatype()
186-
val o2dt = model2.listObjects().toList().asScala.head.asLiteral().getDatatype()
187-
println(s"Object1 = $o1dt, ${o1dt.getClass().getName()}")
188-
println(s"Object2 = $o2dt, ${o2dt.getClass().getName()}")
189-
println(s"Are equal? ${o1dt.equals(o2dt)}")
190-
191-
assertEquals(checkIsomorphic(model1, model2), ().asRight)
192-
}
193169

194170
}

project/metals.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
// This file enables sbt-bloop to create bloop config files.
44

5-
addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.5.3")
5+
addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.5.6")
66

project/project/metals.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
// This file enables sbt-bloop to create bloop config files.
44

5-
addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.5.3")
5+
addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.5.6")
66

project/project/project/metals.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
// This file enables sbt-bloop to create bloop config files.
44

5-
addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.5.3")
5+
addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.5.6")
66

version.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ThisBuild / version := "0.1.122"
1+
ThisBuild / version := "0.1.123"

0 commit comments

Comments
 (0)