public static boolean containsSome( EnhGraph g, Node n, Property p ) { return AbstractProfile.containsSome( g, n, p ); }
/** * <p> * Answer true if the given resource has an alias in this profile. * </p> * * @param res A resource (including properties) to test for an alias * @return True if there is an alias for <code>res</code> */ @Override public boolean hasAliasFor( Resource res ) { return aliasMap().containsKey( res ); }
/** * <p> * Prepare the local alias map by reading the alias table from the concrete sub-class. * </p> */ protected OneToManyMap<Resource, Resource> aliasMap() { if (m_aliasesMap == null) { // aliases map not prepared yet, so initialise using the data from // the concrete profile class m_aliasesMap = new OneToManyMap<>(); Resource[][] aliases = aliasTable(); for ( Resource[] aliase : aliases ) { // since alias relationship is symmetric, we record both directions m_aliasesMap.put( aliase[0], aliase[1] ); m_aliasesMap.put( aliase[1], aliase[0] ); } } return m_aliasesMap; }
/** * <p> * Answer true if the given resource has an alias in this profile. * </p> * * @param res A resource (including properties) to test for an alias * @return True if there is an alias for <code>res</code> */ @Override public boolean hasAliasFor( Resource res ) { return aliasMap().containsKey( res ); }
/** * <p> * Prepare the local alias map by reading the alias table from the concrete sub-class. * </p> */ protected OneToManyMap<Resource, Resource> aliasMap() { if (m_aliasesMap == null) { // aliases map not prepared yet, so initialise using the data from // the concrete profile class m_aliasesMap = new OneToManyMap<>(); Resource[][] aliases = aliasTable(); for ( Resource[] aliase : aliases ) { // since alias relationship is symmetric, we record both directions m_aliasesMap.put( aliase[0], aliase[1] ); m_aliasesMap.put( aliase[1], aliase[0] ); } } return m_aliasesMap; }
public static boolean containsSome( EnhGraph g, Node n, Property p ) { return AbstractProfile.containsSome( g, n, p ); }
/** * <p> * Answer an iterator over the defined aliases for a resource. * </p> * * @param res A resource (including properties) * @return An iterator over the aliases for <code>res</code>. If there are * no aliases, the empty iterator is returned. */ @Override public Iterator<Resource> listAliasesFor( Resource res ) { return aliasMap().getAll( res ); }
public static boolean containsSome( EnhGraph g, Node n, Property p ) { return AbstractProfile.containsSome( g, n, p ); }
/** * <p> * Answer an iterator over the defined aliases for a resource. * </p> * * @param res A resource (including properties) * @return An iterator over the aliases for <code>res</code>. If there are * no aliases, the empty iterator is returned. */ @Override public Iterator<Resource> listAliasesFor( Resource res ) { return aliasMap().getAll( res ); }
public static boolean containsSome( EnhGraph g, Node n, Property p ) { return AbstractProfile.containsSome( g, n, p ); }
/** * <p> * Answer an alias for the given resource. If there is more than * one such alias, a choice is made non-deterministically between the * alternatives. * </p> * * @param res A resource (including properties) to test for an alias * @return The alias for <code>res</code>, or one of the aliases for <code>res</code> if more * than one is defined, or null if no alias is defined for <code>res</code>. * */ @Override public Resource getAliasFor( Resource res ) { return aliasMap().get( res ); }
public static boolean containsSome( EnhGraph g, Node n, Property p ) { return AbstractProfile.containsSome( g, n, p ); }
/** * <p> * Answer an alias for the given resource. If there is more than * one such alias, a choice is made non-deterministically between the * alternatives. * </p> * * @param res A resource (including properties) to test for an alias * @return The alias for <code>res</code>, or one of the aliases for <code>res</code> if more * than one is defined, or null if no alias is defined for <code>res</code>. * */ @Override public Resource getAliasFor( Resource res ) { return aliasMap().get( res ); }
public static boolean containsSome( EnhGraph g, Node n, Property p ) { return AbstractProfile.containsSome( g, n, p ); }
@Override public boolean canWrap( Node node, EnhGraph eg ) { // node will support being an IntersectionClass facet if it has rdf:type owl:Class and an owl:intersectionOf statement (or equivalents) Profile profile = (eg instanceof OntModel) ? ((OntModel) eg).getProfile() : null; return (profile != null) && profile.isSupported( node, eg, OntClass.class ) && AbstractProfile.containsSome( eg, node, profile.INTERSECTION_OF() ); } };
@Override public boolean canWrap( Node node, EnhGraph eg ) { // node will support being an IntersectionClass facet if it has rdf:type owl:Class and an owl:intersectionOf statement (or equivalents) Profile profile = (eg instanceof OntModel) ? ((OntModel) eg).getProfile() : null; return (profile != null) && profile.isSupported( node, eg, OntClass.class ) && AbstractProfile.containsSome( eg, node, profile.INTERSECTION_OF() ); } };