import org.simantics.db.exception.DatabaseException;
import org.simantics.db.exception.NoSingleResultException;
import org.simantics.db.layer0.exception.MissingVariableValueException;
import org.simantics.db.exception.DatabaseException;
import org.simantics.db.exception.NoSingleResultException;
import org.simantics.db.layer0.exception.MissingVariableValueException;
public StandardGraphResourcePropertyVariable(ReadGraph graph, Variable parent, Resource parentResource, Resource property) throws DatabaseException {
super(graph, parent, null, parentResource, property);
}
public StandardGraphResourcePropertyVariable(ReadGraph graph, Variable parent, Resource parentResource, Resource property) throws DatabaseException {
super(graph, parent, null, parentResource, property);
}
try {
return (T)graph.getSingleObject(parentResource, property.predicate);
} catch (NoSingleResultException e) {
try {
return (T)graph.getSingleObject(parentResource, property.predicate);
} catch (NoSingleResultException e) {
- System.err.println("No object for " + parentResource + " " + property);
- throw new MissingVariableValueException(getPossibleURI(graph));
+ LOGGER.error("No object for " + parentResource + " " + property);
+ throw new MissingVariableValueException(getPossibleURI(graph), e);
}
}
@Override
public <T> T getValue(ReadGraph graph, Binding binding) throws DatabaseException {
if (parentResource == null)
}
}
@Override
public <T> T getValue(ReadGraph graph, Binding binding) throws DatabaseException {
if (parentResource == null)
try {
return (T)graph.getSingleObject(parentResource, property.predicate);
} catch (NoSingleResultException e) {
try {
return (T)graph.getSingleObject(parentResource, property.predicate);
} catch (NoSingleResultException e) {
- System.err.println("No object for " + parentResource + " " + property);
- throw new MissingVariableValueException(getPossibleURI(graph));
+ LOGGER.error("No object for " + parentResource + " " + property);
+ throw new MissingVariableValueException(getPossibleURI(graph), e);