public RVF_TAX(G g, Direction dir) { super(g, new WalkConstraintGeneric(RDFS.SUBCLASSOF, dir)); }
public RVF_TAX(G g, Direction dir) { super(g, new WalkConstraintGeneric(RDFS.SUBCLASSOF, dir)); }
/** * @param g * @param root * @return true if the graph contains a taxonomic graph which is rooted by a * unique vertex. * @throws SLIB_Ex_Critic */ public boolean isUniqueRootedTaxonomicDag(G g, URI root) throws SLIB_Ex_Critic { WalkConstraint wc = new WalkConstraintGeneric(RDFS.SUBCLASSOF, Direction.IN); return isUniqueRootedDagRoot(g, root, wc); }
/** * * @param graph * @return true if the graph contains a taxonomic graph. * @throws SLIB_Ex_Critic */ public boolean containsTaxonomicDag(G graph) throws SLIB_Ex_Critic { WalkConstraint wct = new WalkConstraintGeneric(RDFS.SUBCLASSOF, Direction.IN); return isDag(graph, wct); }
/** * Return the vertices which root the taxonomic graph. * * @param g * @return the vertices which can be considered as a root, i.e. all the * vertices which are not subsumed by an other vertex through a taxonomic * relationship. */ public Set<URI> getTaxonomicRoots(G g) { return getDAGRoots(g, new WalkConstraintGeneric(RDFS.SUBCLASSOF, Direction.OUT)); }
/** * * @param graph * @return true if the graph contains a taxonomic graph. * @throws SLIB_Ex_Critic */ public boolean containsTaxonomicDag(G graph) throws SLIB_Ex_Critic { WalkConstraint wct = new WalkConstraintGeneric(RDFS.SUBCLASSOF, Direction.IN); return isDag(graph, wct); }
/** * * @param graph * @return true if the graph contains a taxonomic graph. * @throws SLIB_Ex_Critic */ public boolean containsTaxonomicDag(G graph) throws SLIB_Ex_Critic { WalkConstraint wct = new WalkConstraintGeneric(RDFS.SUBCLASSOF, Direction.IN); return isDag(graph, wct); }
/** * @param g * @param root * @return true if the graph contains a taxonomic graph which is rooted by a * unique vertex. * @throws SLIB_Ex_Critic */ public boolean isUniqueRootedTaxonomicDag(G g, URI root) throws SLIB_Ex_Critic { WalkConstraint wc = new WalkConstraintGeneric(RDFS.SUBCLASSOF, Direction.IN); return isUniqueRootedDagRoot(g, root, wc); }
/** * * @param graph * @return true if the graph contains a taxonomic graph. * @throws SLIB_Ex_Critic */ public boolean containsTaxonomicDag(G graph) throws SLIB_Ex_Critic { WalkConstraint wct = new WalkConstraintGeneric(RDFS.SUBCLASSOF, Direction.IN); return isDag(graph, wct); }
/** * Return the vertices which root the taxonomic graph. * * @param g * @return the vertices which can be considered as a root, i.e. all the * vertices which are not subsumed by an other vertex through a taxonomic * relationship. */ public Set<URI> getTaxonomicRoots(G g) { return getDAGRoots(g, new WalkConstraintGeneric(RDFS.SUBCLASSOF, Direction.OUT)); }
/** * @param g * @param root * @return true if the graph contains a taxonomic graph which is rooted by a * unique vertex. * @throws SLIB_Ex_Critic */ public boolean isUniqueRootedTaxonomicDag(G g, URI root) throws SLIB_Ex_Critic { WalkConstraint wc = new WalkConstraintGeneric(RDFS.SUBCLASSOF, Direction.IN); return isUniqueRootedDagRoot(g, root, wc); }
/** * Return the vertices which root the taxonomic graph. * * @param g * @return the vertices which can be considered as a root, i.e. all the * vertices which are not subsumed by an other vertex through a taxonomic * relationship. */ public Set<URI> getTaxonomicRoots(G g) { return getDAGRoots(g, new WalkConstraintGeneric(RDFS.SUBCLASSOF, Direction.OUT)); }
/** * @param g * @param root * @return true if the graph contains a taxonomic graph which is rooted by a * unique vertex. * @throws SLIB_Ex_Critic */ public boolean isUniqueRootedTaxonomicDag(G g, URI root) throws SLIB_Ex_Critic { WalkConstraint wc = new WalkConstraintGeneric(RDFS.SUBCLASSOF, Direction.IN); return isUniqueRootedDagRoot(g, root, wc); }
/** * Return the vertices which root the taxonomic graph. * * @param g * @return the vertices which can be considered as a root, i.e. all the * vertices which are not subsumed by an other vertex through a taxonomic * relationship. */ public Set<URI> getTaxonomicRoots(G g) { return getDAGRoots(g, new WalkConstraintGeneric(RDFS.SUBCLASSOF, Direction.OUT)); }
/** * Return the unique vertex rooting the underlying taxonomic graph. Do not * check if the taxonomic graph is a DAG but throw an error if the taxonomic * graph contains multiple roots. * * @param g the graph * @return the unique vertex which roots the taxonomic graph * * @throws SLIB_Ex_Critic if the underlying taxonomic graph of the * given graph contains multiple roots. * */ public URI getUniqueTaxonomicRoot(G g) throws SLIB_Ex_Critic { WalkConstraintGeneric wcTax = new WalkConstraintGeneric(RDFS.SUBCLASSOF, Direction.OUT); Set<URI> roots = getDAGRoots(g, wcTax); if (roots.size() != 1) { throw new SLIB_Ex_Critic("Multiple roots detected in the underlying taxonomic graph of graph " + g.getURI()); } return roots.iterator().next(); }
/** * Root the underlying taxonomic DAG of the specified graph. * * @param g * @param rootUri * @return the URI of the root * @throws SLIB_Ex_Critic */ public static URI rootUnderlyingTaxonomicDAG(G g, URI rootUri) throws SLIB_Ex_Critic { Logger logger = LoggerFactory.getLogger(RooterDAG.class); logger.info("Rooting taxonomic Graph using " + rootUri); ValidatorDAG validator = new ValidatorDAG(); if (!validator.containsTaxonomicDagWithUniqueRoot(g)) { return rootUnderlyingDAG(g, rootUri, new WalkConstraintGeneric(RDFS.SUBCLASSOF,Direction.OUT),true); } else { return validator.getUniqueTaxonomicRoot(g); } } }
/** * Root the underlying taxonomic DAG of the specified graph. * * @param g * @param rootUri * @return the URI of the root * @throws SLIB_Ex_Critic */ public static URI rootUnderlyingTaxonomicDAG(G g, URI rootUri) throws SLIB_Ex_Critic { Logger logger = LoggerFactory.getLogger(RooterDAG.class); logger.info("Rooting taxonomic Graph using " + rootUri); ValidatorDAG validator = new ValidatorDAG(); if (!validator.containsTaxonomicDagWithUniqueRoot(g)) { return rootUnderlyingDAG(g, rootUri, new WalkConstraintGeneric(RDFS.SUBCLASSOF,Direction.OUT),true); } else { return validator.getUniqueTaxonomicRoot(g); } } }
/** * Root the underlying taxonomic DAG of the specified graph. * * @param g * @param rootUri * @return the URI of the root * @throws SLIB_Ex_Critic */ public static URI rootUnderlyingTaxonomicDAG(G g, URI rootUri) throws SLIB_Ex_Critic { Logger logger = LoggerFactory.getLogger(RooterDAG.class); logger.info("Rooting taxonomic Graph using " + rootUri); ValidatorDAG validator = new ValidatorDAG(); if (!validator.containsTaxonomicDagWithUniqueRoot(g)) { return rootUnderlyingDAG(g, rootUri, new WalkConstraintGeneric(RDFS.SUBCLASSOF,Direction.OUT),true); } else { return validator.getUniqueTaxonomicRoot(g); } } }
public static WalkConstraint copy(WalkConstraint walkConstraint) { WalkConstraintGeneric newwc = new WalkConstraintGeneric(); newwc.addAcceptedTraversal(walkConstraint.getAcceptedWalks_DIR_IN(), Direction.IN); newwc.addAcceptedTraversal(walkConstraint.getAcceptedWalks_DIR_OUT(), Direction.OUT); newwc.addAcceptedTraversal(walkConstraint.getAcceptedWalks_DIR_BOTH(), Direction.BOTH); return newwc; } }
public static WalkConstraint copy(WalkConstraint walkConstraint) { WalkConstraintGeneric newwc = new WalkConstraintGeneric(); newwc.addAcceptedTraversal(walkConstraint.getAcceptedWalks_DIR_IN(), Direction.IN); newwc.addAcceptedTraversal(walkConstraint.getAcceptedWalks_DIR_OUT(), Direction.OUT); newwc.addAcceptedTraversal(walkConstraint.getAcceptedWalks_DIR_BOTH(), Direction.BOTH); return newwc; } }