ShaclSailConfig extends AbstractDelegatingSailImplConfig { @Override public void parse(Model m, Resource implNode) throws SailConfigException { super.parse(m, implNode); try { Models.objectLiteral(m.getStatements(implNode, PARALLEL_VALIDATION, null)) .ifPresent(l -> setParallelValidation(l.booleanValue())); Models.objectLiteral(m.getStatements(implNode, UNDEFINED_TARGET_VALIDATES_ALL_SUBJECTS, null)) .ifPresent(l -> setUndefinedTargetValidatesAllSubjects(l.booleanValue())); Models.objectLiteral(m.getStatements(implNode, LOG_VALIDATION_PLANS, null)) .ifPresent(l -> setLogValidationPlans(l.booleanValue())); Models.objectLiteral(m.getStatements(implNode, LOG_VALIDATION_VIOLATIONS, null)) .ifPresent(l -> setLogValidationViolations(l.booleanValue())); Models.objectLiteral(m.getStatements(implNode, IGNORE_NO_SHAPES_LOADED_EXCEPTION, null)) .ifPresent(l -> setIgnoreNoShapesLoadedException(l.booleanValue())); Models.objectLiteral(m.getStatements(implNode, VALIDATION_ENABLED, null)) .ifPresent(l -> setValidationEnabled(l.booleanValue())); Models.objectLiteral(m.getStatements(implNode, CACHE_SELECT_NODES, null)) .ifPresent(l -> setCacheSelectNodes(l.booleanValue())); Models.objectLiteral(m.getStatements(implNode, GLOBAL_LOG_VALIDATION_EXECUTION, null)) .ifPresent(l -> setGlobalLogValidationExecution(l.booleanValue())); Models.objectLiteral(m.getStatements(implNode, RDFS_SUB_CLASS_REASONING, null)) .ifPresent(l -> setRdfsSubClassReasoning(l.booleanValue())); Models.objectLiteral(m.getStatements(implNode, PERFORMANCE_LOGGING, null)) .ifPresent(l -> setPerformanceLogging(l.booleanValue())); Models.objectLiteral(m.getStatements(implNode, SERIALIZABLE_VALIDATION, null)) .ifPresent(l -> setSerializableValidation(l.booleanValue())); Models.objectLiteral(m.getStatements(implNode, ShaclSailSchema.ECLIPSE_RDF4J_SHACL_EXTENSIONS, null)) .ifPresent(l -> setEclipseRdf4jShaclExtensions(l.booleanValue())); Models.objectLiteral(m.getStatements(implNode, ShaclSailSchema.DASH_DATA_SHAPES, null)) .ifPresent(l -> setDashDataShapes(l.booleanValue())); Models.objectLiteral(m.getStatements(implNode, ShaclSailSchema.VALIDATION_RESULTS_LIMIT_TOTAL, null)) .ifPresent(l -> setValidationResultsLimitTotal(l.longValue())); Models.objectLiteral( m.getStatements(implNode, ShaclSailSchema.VALIDATION_RESULTS_LIMIT_PER_CONSTRAINT, null)) .ifPresent(l -> setValidationResultsLimitPerConstraint(l.longValue())); } catch (IllegalArgumentException e) { throw new SailConfigException("error parsing Sail configuration", e); } } ShaclSailConfig();  ShaclSailConfig(SailImplConfig delegate); @Deprecated boolean isUndefinedTargetValidatesAllSubjects(); @Deprecated void setUndefinedTargetValidatesAllSubjects(boolean undefinedTargetValidatesAllSubjects); boolean isLogValidationPlans(); void setLogValidationPlans(boolean logValidationPlans); boolean isLogValidationViolations(); void setLogValidationViolations(boolean logValidationViolations); boolean isGlobalLogValidationExecution(); void setGlobalLogValidationExecution(boolean globalLogValidationExecution); @Deprecated boolean isIgnoreNoShapesLoadedException(); @Deprecated void setIgnoreNoShapesLoadedException(boolean ignoreNoShapesLoadedException); boolean isValidationEnabled(); void setValidationEnabled(boolean validationEnabled); boolean isParallelValidation(); void setParallelValidation(boolean parallelValidation); boolean isCacheSelectNodes(); void setCacheSelectNodes(boolean cacheSelectNodes); boolean isRdfsSubClassReasoning(); void setRdfsSubClassReasoning(boolean rdfsSubClassReasoning); boolean isPerformanceLogging(); void setPerformanceLogging(boolean performanceLogging); boolean isSerializableValidation(); void setSerializableValidation(boolean serializableValidation); @Experimental boolean isEclipseRdf4jShaclExtensions(); @Experimental void setEclipseRdf4jShaclExtensions(boolean eclipseRdf4jShaclExtensions); @Experimental boolean isDashDataShapes(); @Experimental void setDashDataShapes(boolean dashDataShapes); long getValidationResultsLimitTotal(); long getValidationResultsLimitPerConstraint(); void setValidationResultsLimitTotal(long validationResultsLimitTotal); void setValidationResultsLimitPerConstraint(long validationResultsLimitPerConstraint); @Override Resource export(Model m); @Override void parse(Model m, Resource implNode); static final boolean PARALLEL_VALIDATION_DEFAULT; static final boolean UNDEFINED_TARGET_VALIDATES_ALL_SUBJECTS_DEFAULT; static final boolean LOG_VALIDATION_PLANS_DEFAULT; static final boolean LOG_VALIDATION_VIOLATIONS_DEFAULT; static final boolean IGNORE_NO_SHAPES_LOADED_EXCEPTION_DEFAULT; static final boolean VALIDATION_ENABLED_DEFAULT; static final boolean CACHE_SELECT_NODES_DEFAULT; static final boolean GLOBAL_LOG_VALIDATION_EXECUTION_DEFAULT; static final boolean RDFS_SUB_CLASS_REASONING_DEFAULT; static final boolean PERFORMANCE_LOGGING_DEFAULT; static final boolean SERIALIZABLE_VALIDATION_DEFAULT; static final boolean ECLIPSE_RDF4J_SHACL_EXTENSIONS_DEFAULT; static final boolean DASH_DATA_SHAPES_DEFAULT; final static long VALIDATION_RESULTS_LIMIT_TOTAL_DEFAULT; final static long VALIDATION_RESULTS_LIMIT_PER_CONSTRAINT_DEFAULT; }
@Test(expected = SailConfigException.class) public void parseInvalidModelGivesCorrectException() { ShaclSailConfig shaclSailConfig = new ShaclSailConfig(); BNode implNode = SimpleValueFactory.getInstance().createBNode(); ModelBuilder mb = new ModelBuilder().subject(implNode); mb.add(PARALLEL_VALIDATION, "I'm not a boolean"); shaclSailConfig.parse(mb.build(), implNode); }