java.lang.RuntimeException: Should not happen
at org.aksw.sparqlify.restriction.RestrictionImpl.getNodeType(RestrictionImpl.java:234)
at org.aksw.sparqlify.restriction.RestrictionImpl.stateNode(RestrictionImpl.java:243)
at org.aksw.sparqlify.database.Clause.deriveRestrictionEquals(Clause.java:66)
at org.aksw.sparqlify.database.Clause.deriveRestrictionEquals(Clause.java:57)
at org.aksw.sparqlify.database.Clause.<init>(Clause.java:41)
at org.aksw.sparqlify.database.Clause.<init>(Clause.java:32)
...
The following changes work for me but I don't know if they really solve a problem or just make an error not to appear:
diff --git a/sparqlify-core/src/main/java/org/aksw/sparqlify/restriction/RdfTermType.java b/sparqlify-core/src/main/java/org/aksw/sparqlify/restriction/RdfTermType.java
index c667012..4749a21 100644
--- a/sparqlify-core/src/main/java/org/aksw/sparqlify/restriction/RdfTermType.java
+++ b/sparqlify-core/src/main/java/org/aksw/sparqlify/restriction/RdfTermType.java
@@ -8,7 +8,7 @@ package org.aksw.sparqlify.restriction;
*/
public enum RdfTermType {
UNKNOWN,
- //BLANK,
+ BLANK,
URI, // TODO This should probably be resource (i.e. uri + blank node)
LITERAL,
//PLAIN_LITERAL,
diff --git a/sparqlify-core/src/main/java/org/aksw/sparqlify/restriction/RestrictionImpl.java b/sparqlify-core/src/main/java/org/aksw/sparqlify/restriction/RestrictionImpl.java
index 1b733c7..061a465 100644
--- a/sparqlify-core/src/main/java/org/aksw/sparqlify/restriction/RestrictionImpl.java
+++ b/sparqlify-core/src/main/java/org/aksw/sparqlify/restriction/RestrictionImpl.java
@@ -230,6 +230,8 @@ public class RestrictionImpl
return RdfTermType.URI;
} else if(node.isLiteral()) {
return RdfTermType.LITERAL;
+ } else if(node.isBlank()) {
+ return RdfTermType.BLANK;
} else {
throw new RuntimeException("Should not happen");
}
When using blank nodes in one of the
Node
s (gv
,sv
,pv
,ov
) in code likeI get this trace:
The following changes work for me but I don't know if they really solve a problem or just make an error not to appear: