diff --git a/src/sparnatural/generators/sparql/WhereBuilder.ts b/src/sparnatural/generators/sparql/WhereBuilder.ts index fb1afd67..6d20601c 100644 --- a/src/sparnatural/generators/sparql/WhereBuilder.ts +++ b/src/sparnatural/generators/sparql/WhereBuilder.ts @@ -185,7 +185,11 @@ export default class WhereBuilder{ const hasEndClass = ( !this.#specProvider.getEntity(this.#grpWrapper.CriteriaGroup.EndClassGroup.getTypeSelected()).isLiteralEntity() && - !this.#specProvider.getProperty(this.#grpWrapper.CriteriaGroup.ObjectPropertyGroup.getTypeSelected()).omitClassCriteria() + ( + this.#grpWrapper.CriteriaGroup.ObjectPropertyGroup.getTypeSelected() == null + || + !this.#specProvider.getProperty(this.#grpWrapper.CriteriaGroup.ObjectPropertyGroup.getTypeSelected()).omitClassCriteria() + ) ); const hasIntersectionTriple = (this.#intersectionPtrn)