Github user afs commented on a diff in the pull request: https://github.com/apache/jena/pull/314#discussion_r153745192 --- Diff: jena-core/src/main/java/org/apache/jena/assembler/assemblers/AssemblerBase.java --- @@ -63,11 +63,16 @@ protected static RDFNode getUnique( Resource root, Property property ) throw new NotUniqueException( root, property ); } - protected void checkType( Resource root, Resource type ) - { - if (!root.hasProperty( RDF.type, type )) - throw new CannotConstructException( this.getClass(), root, type ); - } + /** + * Throws {@link CannotConstructException} if the offered resource isn't any of the offered types. + * + * @param root resource to check + * @param types types for which to check + */ + protected void checkType( Resource root, Resource... types ) { + for (Resource type : types) if (root.hasProperty( RDF.type, type )) return; --- End diff -- Everything on one line is a bit confusing!
---