Search in sources :

Example 1 with GraphUtilException

use of org.openrdf.model.util.GraphUtilException in project incubator-rya by apache.

the class RyaAccumuloSailConfig method parse.

@Override
public void parse(final Graph graph, final Resource implNode) throws SailConfigException {
    super.parse(graph, implNode);
    System.out.println("parsing");
    try {
        final Literal userLit = GraphUtil.getOptionalObjectLiteral(graph, implNode, USER);
        if (userLit != null) {
            setUser(userLit.getLabel());
        }
        final Literal pwdLit = GraphUtil.getOptionalObjectLiteral(graph, implNode, PASSWORD);
        if (pwdLit != null) {
            setPassword(pwdLit.getLabel());
        }
        final Literal instLit = GraphUtil.getOptionalObjectLiteral(graph, implNode, INSTANCE);
        if (instLit != null) {
            setInstance(instLit.getLabel());
        }
        final Literal zooLit = GraphUtil.getOptionalObjectLiteral(graph, implNode, ZOOKEEPERS);
        if (zooLit != null) {
            setZookeepers(zooLit.getLabel());
        }
        final Literal mockLit = GraphUtil.getOptionalObjectLiteral(graph, implNode, IS_MOCK);
        if (mockLit != null) {
            setMock(Boolean.parseBoolean(mockLit.getLabel()));
        }
    } catch (final GraphUtilException e) {
        throw new SailConfigException(e.getMessage(), e);
    }
}
Also used : Literal(org.openrdf.model.Literal) GraphUtilException(org.openrdf.model.util.GraphUtilException) SailConfigException(org.openrdf.sail.config.SailConfigException)

Aggregations

Literal (org.openrdf.model.Literal)1 GraphUtilException (org.openrdf.model.util.GraphUtilException)1 SailConfigException (org.openrdf.sail.config.SailConfigException)1