/** * <p>Add the given individuals to the list of distinct members of this AllDifferent declaration.</p> * @param individuals An iterator over the distinct invididuals that will be added * @exception ProfileException If the {@link Profile#DISTINCT_MEMBERS()} property is not supported in the current language profile. */ @Override public void addDistinctMembers( Iterator<? extends Resource> individuals ) { while (individuals.hasNext()) { addDistinctMember( individuals.next() ); } }
/** * <p>Add the given individual to the list of distinct members of this AllDifferent declaration.</p> * @param res A resource that will be added to the list of all different members. * @exception ProfileException If the {@link Profile#DISTINCT_MEMBERS()} property is not supported in the current language profile. */ @Override public void addDistinctMember( Resource res ) { addListPropertyValue( getProfile().DISTINCT_MEMBERS(), "DISTINCT_MEMBERS", res ); }
/** * <p>Remove the given resource from the list of distinct individuals. If this statement * is not true of the current model, nothing happens.</p> * @param res A resource that is no longer distinct from the other listed individuals */ @Override public void removeDistinctMember( Resource res ) { setDistinctMembers( getDistinctMembers().remove( res ) ); }
/** * <p>Assert that the list of distinct individuals in this AllDifferent declaration * is the given list. Any existing * statements for <code>distinctMembers</code> will be removed.</p> * @param members A list of the members that are declared to be distinct. * @exception ProfileException If the {@link Profile#DISTINCT_MEMBERS()} property is not supported in the current language profile. */ @Override public void setDistinctMembers( RDFList members ) { setPropertyValue( getProfile().DISTINCT_MEMBERS(), "DISTINCT_MEMBERS", members ); }
/** * <p>Answer the list of distinct members for this AllDifferent declaration.</p> * @return The list of individuals declared distinct by this AllDifferent declaration. * @exception ProfileException If the {@link Profile#DISTINCT_MEMBERS()} property is not supported in the current language profile. */ @Override public RDFList getDistinctMembers() { return objectAs( getProfile().DISTINCT_MEMBERS(), "DISTINCT_MEMBERS", RDFList.class ); }
/** * <p>Answer true if this AllDifferent declaration includes <code>res</code> as one of the distinct individuals.</p> * @param res A resource to test against * @return True if <code>res</code> is declared to be distinct from the other individuals in this declaration. * @exception ProfileException If the {@link Profile#DISTINCT_MEMBERS()} property is not supported in the current language profile. */ @Override public boolean hasDistinctMember( Resource res ) { return getDistinctMembers().contains( res ); }
@Override public EnhNode wrap( Node n, EnhGraph eg ) { if (canWrap( n, eg )) { return new AllDifferentImpl( n, eg ); } else { throw new ConversionException( "Cannot convert node " + n + " to AllDifferent"); } }
/** * <p>Assert that the list of distinct individuals in this AllDifferent declaration * is the given list. Any existing * statements for <code>distinctMembers</code> will be removed.</p> * @param members A list of the members that are declared to be distinct. * @exception ProfileException If the {@link Profile#DISTINCT_MEMBERS()} property is not supported in the current language profile. */ @Override public void setDistinctMembers( RDFList members ) { setPropertyValue( getProfile().DISTINCT_MEMBERS(), "DISTINCT_MEMBERS", members ); }
/** * <p>Answer the list of distinct members for this AllDifferent declaration.</p> * @return The list of individuals declared distinct by this AllDifferent declaration. * @exception ProfileException If the {@link Profile#DISTINCT_MEMBERS()} property is not supported in the current language profile. */ @Override public RDFList getDistinctMembers() { return objectAs( getProfile().DISTINCT_MEMBERS(), "DISTINCT_MEMBERS", RDFList.class ); }
/** * <p>Answer true if this AllDifferent declaration includes <code>res</code> as one of the distinct individuals.</p> * @param res A resource to test against * @return True if <code>res</code> is declared to be distinct from the other individuals in this declaration. * @exception ProfileException If the {@link Profile#DISTINCT_MEMBERS()} property is not supported in the current language profile. */ @Override public boolean hasDistinctMember( Resource res ) { return getDistinctMembers().contains( res ); }
@Override public EnhNode wrap( Node n, EnhGraph eg ) { if (canWrap( n, eg )) { return new AllDifferentImpl( n, eg ); } else { throw new ConversionException( "Cannot convert node " + n + " to AllDifferent"); } }
/** * <p>Remove the given resource from the list of distinct individuals. If this statement * is not true of the current model, nothing happens.</p> * @param res A resource that is no longer distinct from the other listed individuals */ @Override public void removeDistinctMember( Resource res ) { setDistinctMembers( getDistinctMembers().remove( res ) ); }
/** * <p>Add the given individual to the list of distinct members of this AllDifferent declaration.</p> * @param res A resource that will be added to the list of all different members. * @exception ProfileException If the {@link Profile#DISTINCT_MEMBERS()} property is not supported in the current language profile. */ @Override public void addDistinctMember( Resource res ) { addListPropertyValue( getProfile().DISTINCT_MEMBERS(), "DISTINCT_MEMBERS", res ); }
/** * <p>Answer an iterator over all of the individuals that are declared to be distinct by * this AllDifferent declaration. Each element of the iterator will be an {@link OntResource}.</p> * @return An iterator over distinct individuals. * @exception ProfileException If the {@link Profile#DISTINCT_MEMBERS()} property is not supported in the current language profile. */ @Override public ExtendedIterator<? extends OntResource> listDistinctMembers() { return getDistinctMembers().mapWith( o -> ((Resource) o).as( OntResource.class )); }
/** * <p>Add the given individuals to the list of distinct members of this AllDifferent declaration.</p> * @param individuals An iterator over the distinct invididuals that will be added * @exception ProfileException If the {@link Profile#DISTINCT_MEMBERS()} property is not supported in the current language profile. */ @Override public void addDistinctMembers( Iterator<? extends Resource> individuals ) { while (individuals.hasNext()) { addDistinctMember( individuals.next() ); } }
/** * <p>Answer an iterator over all of the individuals that are declared to be distinct by * this AllDifferent declaration. Each element of the iterator will be an {@link OntResource}.</p> * @return An iterator over distinct individuals. * @exception ProfileException If the {@link Profile#DISTINCT_MEMBERS()} property is not supported in the current language profile. */ @Override public ExtendedIterator<? extends OntResource> listDistinctMembers() { return getDistinctMembers().mapWith( o -> ((Resource) o).as( OntResource.class )); }