Skip to content

Commit

Permalink
removed extra printlns
Browse files Browse the repository at this point in the history
  • Loading branch information
labra committed Aug 7, 2019
1 parent 5ab1677 commit c96cf92
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ sealed abstract trait InferredNodeConstraint {
case Ref(lbl) => node match {
case iri: IRI => Ref(lbl)
case _ => {
println(s"Inferred ref($lbl) collapse with $node => None")
// println(s"Inferred ref($lbl) collapse with $node => None")
InferredNone
}
}
Expand Down Expand Up @@ -105,14 +105,14 @@ case class Ref(lbl: IRI) extends InferredNodeConstraint {
other match {
case Ref(otherLbl) => if (lbl == otherLbl) Ref(lbl)
else {
println(s"Inferred references with different labels")
// println(s"Inferred references with different labels")
InferredNone
}
case InferredIRI => {
Ref(lbl)
}
case _ => {
println(s"Inferred references label $lbl and other node $other")
// println(s"Inferred references label $lbl and other node $other")
InferredNone
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@ object SchemaInfer {
numFollowOns: Int
): Comp[Option[InferredShape]] =
if (neighMap.isEmpty) {
println(s"inferShapeFromNeighMap(shapeLabel=$shapeLabel, inferredValues: $inferredValues): EmptyNeighMap")
// println(s"inferShapeFromNeighMap(shapeLabel=$shapeLabel, inferredValues: $inferredValues): EmptyNeighMap")
ok(None)
}
else {
println(s"inferShapeFromNeighMap(shapeLabel=$shapeLabel, neighMap=$neighMap, inferredValues: $inferredValues)")
// println(s"inferShapeFromNeighMap(shapeLabel=$shapeLabel, neighMap=$neighMap, inferredValues: $inferredValues)")
// println(s"Inferring shape for $shapeLabel with neighMap: $neighMap")
for {
rows <- sequence(
Expand Down Expand Up @@ -207,7 +207,7 @@ object SchemaInfer {
shapeLabel: IRI,
numFollowOns: Int
): Comp[Option[IRI]] = for {
_ <- { println(s"inferShapeFromNodes(nodes=$nodes, label=$shapeLabel, numFollowOns=$numFollowOns"); ok(()) }
// _ <- { println(s"inferShapeFromNodes(nodes=$nodes, label=$shapeLabel, numFollowOns=$numFollowOns"); ok(()) }
neighMaps <- sequence(nodes.toList.map(getNeighbourhood(_, numFollowOns)))
ivalues <- collapse(nodes)
lsShapes <- sequence(neighMaps.map(n => inferShapeFromNeighMap(shapeLabel, n, ivalues, numFollowOns + 1)))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package es.weso.shex.validator

import cats._
import cats.implicits._
import com.typesafe.scalalogging.LazyLogging
import es.weso.rdf.RDFReader
import es.weso.rdf.nodes.{IRI, RDFNode}
import es.weso.shex.{BNodeKind, IRIKind, LiteralKind, NodeConstraint, NodeKind, NonLiteralKind, Schema, ValueSetValue, XsFacet}
import es.weso.shex._

case class NodeConstraintChecker(schema: Schema, rdf: RDFReader)
extends ShowValidator(schema) with LazyLogging {
Expand All @@ -18,7 +17,7 @@ case class NodeConstraintChecker(schema: Schema, rdf: RDFReader)
optCheck(nk.datatype, checkDatatype(value)),
checkXsFacets(value)(nk.xsFacets)
).sequence.map(_.mkString)
println(s"Result of nodeConstraintChecker: $rs")
// println(s"Result of nodeConstraintChecker: $rs")
rs
}

Expand Down Expand Up @@ -58,7 +57,7 @@ case class NodeConstraintChecker(schema: Schema, rdf: RDFReader)
if (facets.isEmpty) Right("")
else {
val r = FacetChecker(schema,rdf).facetsChecker(node,facets)
println(s"Result of facets checker: $r")
// println(s"Result of facets checker: $r")
r
}

Expand Down
26 changes: 13 additions & 13 deletions modules/shex/src/main/scala/es/weso/shex/validator/Validator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ case class Validator(schema: Schema,
): CheckTyping = for {
base <- getShape(baseLabel)
paths <- fromEither(s.paths(schema).leftMap(StringError(_)))
_ <- { println(s"checkShapeExtend(node=$node,shape=${s.show},base=$baseLabel). \npaths=$paths") ; ok(()) }
// _ <- { println(s"checkShapeExtend(node=$node,shape=${s.show},base=$baseLabel). \npaths=$paths") ; ok(()) }
neighs <- getNeighPaths(node, paths)
partitions = SetUtils.pSet(neighs.toSet)
_ <- checkSomeFlag(partitions,checkPartition(base,s,attempt,node), noPartition(node, neighs))
Expand All @@ -391,16 +391,16 @@ case class Validator(schema: Schema,
node: RDFNode
)(pair: (Set[Arc],Set[Arc])): Check[(ShapeTyping,Boolean)] = {
val (neighs1,neighs2) = pair
println(s"Checking partition ($neighs1,$neighs2)\n$neighs1 with ${base.show}\nand\n$neighs2 with ${s.show}")
// println(s"Checking partition ($neighs1,$neighs2)\n$neighs1 with ${base.show}\nand\n$neighs2 with ${s.show}")
(for {
pair <- checkNeighsShapeExpr(attempt, node, neighs1.toList, base)
(typing1,flag) = pair
_ <- { println(s"Typing1: $typing1"); ok(()) }
// _ <- { println(s"Typing1: $typing1"); ok(()) }
typing2 <- checkNeighsShape(attempt,node,neighs2.toList,s)
_ <- { println(s"Typing2: $typing2"); ok(()) }
// _ <- { println(s"Typing2: $typing2"); ok(()) }
} yield (typing2,true)) orElse
(for {
_ <- {println(s"partition ($neighs1,$neighs2) failed"); ok(()) }
// _ <- {println(s"partition ($neighs1,$neighs2) failed"); ok(()) }
t <- getTyping
} yield (t,false))
}
Expand All @@ -416,15 +416,15 @@ case class Validator(schema: Schema,
se match {
case s: Shape => (for {
t <- checkNeighsShape(attempt,node,neighs,s)
_ <- { println(s"Failed checkNeighsShape(node=${node.show}, neighs=$neighs, se=${se.show} passed with $t") ; ok(())}
// _ <- { println(s"Failed checkNeighsShape(node=${node.show}, neighs=$neighs, se=${se.show} passed with $t") ; ok(())}
} yield (t,true)) orElse {
for {
_ <- { println(s"Failed checkNeighsShape(node=${node.show}, neighs=$neighs, se=${se.show} failed") ; ok(())}
// _ <- { println(s"Failed checkNeighsShape(node=${node.show}, neighs=$neighs, se=${se.show} failed") ; ok(())}
t <- getTyping
} yield (t,false)
}
case _ => {
println(s"Not implemented yet extends with a non shape base: $se")
// println(s"Not implemented yet extends with a non shape base: $se")
errStr(s"Not implemented yet extends with a non shape base: $se")
}
}
Expand All @@ -449,16 +449,16 @@ case class Validator(schema: Schema,
paths <- fromEither(s.paths(schema).leftMap(StringError(_)))
_ <- { if (s.isClosed) {checkNoStrangeProperties(node, paths)} else ok(()) }
typing <- {
println(s"Before checkCandidates: ${candidates.map(_.show).mkString(",")}\nTable:${cTable.show}\n")
// println(s"Before checkCandidates: ${candidates.map(_.show).mkString(",")}\nTable:${cTable.show}\n")
checkCandidates(attempt, bagChecker, cTable)(candidates)
}
_ <- {println(s"After checkCandidates: $typing"); ok(()) }
// _ <- {println(s"After checkCandidates: $typing"); ok(()) }
_ <- {
// println(s"checkOptSemActs: ${s.actions}")
checkOptSemActs(node,s.actions)
}
} yield {
println(s"End of checkShape(attempt=${attempt.show},node=${node.show},shape=${s.show})=${typing.show}")
// println(s"End of checkShape(attempt=${attempt.show},node=${node.show},shape=${s.show})=${typing.show}")
typing
}

Expand Down Expand Up @@ -561,7 +561,7 @@ case class Validator(schema: Schema,
case _: ShapeRef => Left("Internal error. A normalized ShapeExpr cannot have references ")
case s: Shape if s.isEmpty => Right(s"$node matches empty shape")
case _: Shape => {
println(s"Shape expr: $se")
// println(s"Shape expr: $se")
Left(s"Still don't know what to do with shapes")
}
case _: ShapeExternal => Left(s"Still don't know what to do with external shapes")
Expand Down Expand Up @@ -779,7 +779,7 @@ case class Validator(schema: Schema,
for {
rdf <- getRDF
outTriples <- fromEitherString(rdf.triplesWithSubjectPredicates(node, outgoingPredicates))
_ <- { println(s"Outtriples: $outTriples\nRDF: ${rdf.serialize("TURTLE")}\nNode: $node\nPreds:$outgoingPredicates"); ok(()) }
// _ <- { println(s"Outtriples: $outTriples\nRDF: ${rdf.serialize("TURTLE")}\nNode: $node\nPreds:$outgoingPredicates"); ok(()) }
outgoing = outTriples.map(t => Arc(Direct(t.pred), t.obj)).toList
inTriples <- fromEitherString(rdf.triplesWithObject(node))
incoming = inTriples.map(t => Arc(Inverse(t.pred), t.subj)).toList
Expand Down
2 changes: 1 addition & 1 deletion modules/slang/src/main/scala/es/weso/slang/ShapesMap.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import es.weso.rdf.nodes.RDFNode
case class ShapesMap(map: Map[RDFNode, Value[SLang]]) {

def validated(node: RDFNode, shape: SLang): Boolean = {
println(s"Checking validated $node/$shape")
// println(s"Checking validated $node/$shape")
isConforming(node,shape) match {
case Conforms | NotConforms | Inconsistent => true
case Unknown => false
Expand Down
12 changes: 12 additions & 0 deletions notes/0.1.25.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# New features

- Removed extra println's according to [Issue 150](https://github.com/labra/shaclex/issues/150) and updated libraries

TODOs
-----

- Shaclex: Finish conversion from ShEx to SHACL [Issue 114](https://github.com/labra/shaclex/issues/114)

- Shaclex: Finish conversion from SHACL to ShEx [Issue 113](https://github.com/labra/shaclex/issues/113)

- Shacl: Implement SHACL-Sparql [Issue 112](https://github.com/labra/shaclex/issues/112)
2 changes: 1 addition & 1 deletion version.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version in ThisBuild := "0.1.24"
version in ThisBuild := "0.1.25"

0 comments on commit c96cf92

Please sign in to comment.