return graph.getValue2(object, variable);
} else {
for (Pair<PropertyInfo, Resource> assertion : assertions.values()) {
- if (assertion.first.predicate.equals(variable.property.predicate)) {
+ if (assertion.first.predicate.equals(variable.getPossiblePredicateResource(graph))) {
return graph.getValue2(assertion.second, variable);
}
}
return graph.getValue2(object, variable, binding);
} else {
for (Pair<PropertyInfo, Resource> assertion : assertions.values()) {
- if (assertion.first.predicate.equals(variable.property.predicate)) {
+ if (assertion.first.predicate.equals(variable.getPossiblePredicateResource(graph))) {
return graph.getValue2(assertion.second, variable, binding);
}
}
// Process graph properties
for(Resource predicate : predicates) {
- PropertyInfo info = graph.isImmutable(predicate) ?
- graph.syncRequest(new PropertyInfoRequest(predicate), TransientCacheAsyncListener.<PropertyInfo>instance()) :
- graph.syncRequest(new PropertyInfoRequest(predicate));
+ PropertyInfo info = //graph.isImmutable(predicate) ?
+ graph.syncRequest(new PropertyInfoRequest(predicate), TransientCacheAsyncListener.<PropertyInfo>instance());// :
+ //graph.syncRequest(new PropertyInfoRequest(predicate));
if(!info.isHasProperty) continue;
public static PropertyInfo getPossiblePropertyInfoFromContext(ReadGraph graph, Variable variable, Resource context, String name) throws DatabaseException {
if(context == null) return null;
- Map<String, PropertyInfo> predicates = graph.syncRequest(new UnescapedPropertyMapOfResource(context));
+ Map<String, PropertyInfo> predicates = graph.syncRequest(new UnescapedPropertyMapOfResource(context), TransientCacheListener.instance());
return predicates.get(name);
}
if(property instanceof StandardGraphPropertyVariable) {
StandardGraphPropertyVariable variable = (StandardGraphPropertyVariable)property;
if (variable.parentResource != null) {
- Statement stm = graph.getPossibleStatement(variable.parentResource, variable.property.predicate);
- return stm != null && stm.isAsserted(variable.parentResource);
+ Resource predicate = variable.getPossiblePredicateResource(graph);
+ if (predicate != null) {
+ Statement stm = graph.getPossibleStatement(variable.parentResource, predicate);
+ return stm != null && stm.isAsserted(variable.parentResource);
+ }
}
}
return Boolean.FALSE;
throw new InvalidVariableException("Variable is not represented by any resource (URI=" + variable.getPossibleURI(graph) + ").");
try {
- return graph.getRelatedValue2(variable.parentResource, variable.property.predicate, variable);
+ return graph.getRelatedValue2(variable.parentResource, variable.getPredicateResource(graph), variable);
} catch (NoSingleResultException e) {
throw new MissingVariableValueException(variable.getPossibleURI(graph), e);
} catch (DoesNotContainValueException e) {
if (variable.parentResource == null)
throw new MissingVariableException("Variable is not represented by any resource (URI=" + variable.getPossibleURI(graph) + ").", context.getPossibleRepresents(graph));
+
try {
- return graph.getRelatedValue2(variable.parentResource, variable.property.predicate, variable);
+ return graph.getRelatedValue2(variable.parentResource, variable.getPredicateResource(graph), variable);
} catch (NoSingleResultException e) {
throw new MissingVariableValueException(variable.getPossibleURI(graph), e);
} catch (DoesNotContainValueException e) {