congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
AncestorEngine
Code IndexAdd Tabnine to your IDE (free)

How to use
AncestorEngine
in
slib.graph.algo.extraction.rvf

Best Java code snippets using slib.graph.algo.extraction.rvf.AncestorEngine (Showing top 16 results out of 315)

origin: com.github.sharispe/slib-sml

/**
 * Compute the inclusive ancestors for all classes.
 *
 * @throws SLIB_Ex_Critic
 */
private void computeAllclassesAncestors() throws SLIB_Ex_Critic {
  cache.ancestorsInc = ancGetter.getAllAncestorsInc();
}
origin: com.github.sharispe/slib-graph-algo

/**
 * Compute the set of exclusive ancestors of all vertices contained in the
 * graph. Exclusive process: the focused vertex will NOT be included in the
 * set of ancestors.
 *
 * @return a map containing the exclusive set of ancestors of each vertex
 * concept (empty set if any).
 * @throws SLIB_Ex_Critic
 */
public Map<URI, Set<URI>> getAllAncestorsExc() throws SLIB_Ex_Critic {
  return getAllRV();
}
origin: sharispe/slib

  /**
   * Compute the set of inclusive ancestors of all vertices contained in the
   * graph. The focused vertex will be included in the set of ancestors.
   *
   * @return a map containing the inclusive set of ancestors of each vertex
   * concept.
   * @throws SLIB_Ex_Critic
   */
  public Map<URI, Set<URI>> getAllAncestorsInc() throws SLIB_Ex_Critic {

    return getAllRVInc();
  }
}
origin: com.github.sharispe/slib-sml

/**
 * CACHED ! Be careful modification of RelTypes requires cache clearing
 *
 * @param a
 * @param b
 * @param weightingScheme
 * @return the shortest path between the two classes considering the given
 * weighting scheme.
 * @throws SLIB_Ex_Critic
 */
public double getShortestPath(URI a, URI b, GWS weightingScheme) throws SLIB_Ex_Critic {
  if (cache.shortestPath.get(a) == null || cache.shortestPath.get(a).get(b) == null) {
    if (cache.shortestPath.get(a) == null) {
      cache.shortestPath.put(a, new ConcurrentHashMap<URI, Double>());
    }
    WalkConstraint wc = WalkConstraintUtils.copy(ancGetter.getWalkConstraint());
    wc.addWalkconstraints(descGetter.getWalkConstraint());
    Dijkstra dijkstra = new Dijkstra(graph, wc, weightingScheme);
    double sp = dijkstra.shortestPath(a, b);
    cache.shortestPath.get(a).put(b, sp);
  }
  return cache.shortestPath.get(a).get(b);
}
origin: com.github.sharispe/slib-graph-algo

/**
 * Compute the set of exclusive ancestors of a class. Exclusive process: the
 * focused vertex will NOT be included in the set of ancestors.
 *
 * @param v the vertex of interest
 * @return the exclusive set of ancestors of the concept (empty set if any).
 */
public Set<URI> getAncestorsExc(URI v) {
  return getRV(v);
}
origin: com.github.sharispe/slib-sml

logger.info(g.toString());
ancGetter = new AncestorEngine(graph);
descGetter = new DescendantEngine(graph);
origin: com.github.sharispe/slib-sml

/**
 * Get the parents of a class, that is to say its direct ancestors.
 *
 * <br/><b>Important</b>:<br/>
 *
 * The direct parent of a class are all classes x linked to the given class
 * c to a an edge x RDFS.SUBLASSOF c. The result is not cached by the
 * engine. To ensure result coherency the underlying requires to be
 * transitively reduced, refer to the class documentation for more
 * information.
 *
 * @param v the focus vertex
 * @return the set of parents of the given vertex
 */
public Set<URI> getParents(URI v) {
  throwErrorIfNotClass(v);
  Set<URI> parents = graph.getV(v, ancGetter.getWalkConstraint());
  return parents;
}
origin: sharispe/slib

/**
 * Compute the set of exclusive ancestors of a class. Exclusive process: the
 * focused vertex will NOT be included in the set of ancestors.
 *
 * @param v the vertex of interest
 * @return the exclusive set of ancestors of the concept (empty set if any).
 */
public Set<URI> getAncestorsExc(URI v) {
  return getRV(v);
}
origin: sharispe/slib

/**
 * Constructor of an engine associated to the given graph. The taxonomic
 * relationship used is rdfs:subClassOf
 *
 * Note that the engine expects the graph not to be modified and coherency
 * of results are only ensured in this case. Please refer to the general
 * documentation of the class for more information considering this specific
 * restriction.
 *
 * The engine creation is expensive, avoid useless calls to the constructor.
 * Indeed, some information such as classes and instances of the graph are
 * computed at engine creation which can lead to performance issues dealing
 * with large graphs.
 *
 * @param g the graph associated to the engine.
 * @throws SLIB_Ex_Critic
 */
public SM_Engine(final G g) throws SLIB_Ex_Critic {
  this.graph = g;
  topNodeAccessor = new AncestorEngine(graph);
  bottomNodeAccessor = new DescendantEngine(graph);
  logger.info("Computing classes...");
  classes = GraphAccessor.getClasses(graph);
  instanceAccessor = new InstanceAccessorTax(graph);
  initEngine();
}
origin: com.github.sharispe/slib-sml

Set<URI> roots = new ValidatorDAG().getDAGRoots(graph, ancGetter.getWalkConstraint());
DFS dfs = new DFS(graph, roots, WalkConstraintUtils.getInverse(ancGetter.getWalkConstraint(), (false)));
List<URI> topoOrdering = dfs.getTraversalOrder();
  for (E e : graph.getE(c, ancGetter.getWalkConstraint())) {
origin: com.github.sharispe/slib-graph-algo

/**
 * Compute the set of inclusive ancestors of a class. The focused vertex
 * will be included in the set of ancestors.
 *
 * @param v the vertex of interest
 * @return the set composed of the ancestors of the concept + the concept.
 */
public Set<URI> getAncestorsInc(URI v) {
  Set<URI> set = getRV(v);
  set.add(v);
  return set;
}
origin: sharispe/slib

/**
 * Compute the set of exclusive ancestors of all vertices contained in the
 * graph. Exclusive process: the focused vertex will NOT be included in the
 * set of ancestors.
 *
 * @return a map containing the exclusive set of ancestors of each vertex
 * concept (empty set if any).
 * @throws SLIB_Ex_Critic
 */
public Map<URI, Set<URI>> getAllAncestorsExc() throws SLIB_Ex_Critic {
  return getAllRV();
}
origin: com.github.sharispe/slib-sml

/**
 * CACHED
 *
 * @param a
 * @param weightingScheme
 * @return a map containing the weight of the shortest path linking a the
 * given vertex.
 *
 * @throws SLIB_Ex_Critic
 */
public synchronized Map<URI, Double> getAllShortestPath(URI a, GWS weightingScheme) throws SLIB_Ex_Critic {
  if (cache.shortestPath.get(a) == null) {
    WalkConstraint wc = WalkConstraintUtils.copy(ancGetter.getWalkConstraint());
    wc.addWalkconstraints(descGetter.getWalkConstraint());
    Dijkstra dijkstra = new Dijkstra(graph, wc, weightingScheme);
    ConcurrentHashMap<URI, Double> minDists_cA = dijkstra.shortestPath(a);
    cache.shortestPath.put(a, minDists_cA);
  }
  return cache.shortestPath.get(a);
}
origin: sharispe/slib

/**
 * Compute the set of inclusive ancestors of a class. The focused vertex
 * will be included in the set of ancestors.
 *
 * @param v the vertex of interest
 * @return the set composed of the ancestors of the concept + the concept.
 */
public Set<URI> getAncestorsInc(URI v) {
  Set<URI> set = getRV(v);
  set.add(v);
  return set;
}
origin: com.github.sharispe/slib-graph-algo

  /**
   * Compute the set of inclusive ancestors of all vertices contained in the
   * graph. The focused vertex will be included in the set of ancestors.
   *
   * @return a map containing the inclusive set of ancestors of each vertex
   * concept.
   * @throws SLIB_Ex_Critic
   */
  public Map<URI, Set<URI>> getAllAncestorsInc() throws SLIB_Ex_Critic {

    Map<URI, Set<URI>> allAncs = getAllRV();
    for (URI v : allAncs.keySet()) {
      allAncs.get(v).add(v);
    }
    return allAncs;
  }
}
origin: com.github.sharispe/slib-sml

/**
 * NOT_CACHED
 *
 * @param a
 * @param b
 * @param weightingScheme
 * @return the URI associated to the Most Specific Ancestor.
 * @throws SLIB_Ex_Critic
 */
public URI getMSA(URI a, URI b, GWS weightingScheme) throws SLIB_Ex_Critic {
  Dijkstra dijkstra = new Dijkstra(graph, ancGetter.getWalkConstraint(), weightingScheme);
  URI msa_pk = SimDagEdgeUtils.getMSA_pekar_staab(getRoot(), getAllShortestPath(a, weightingScheme), getAllShortestPath(b, weightingScheme), getAncestorsInc(a), getAncestorsInc(b), dijkstra);
  return msa_pk;
}
slib.graph.algo.extraction.rvfAncestorEngine

Javadoc

Class used to provide an easy way to retrieve the ancestors of a concept (super classes of a class).

Most used methods

  • <init>
    Build an ancestor engine associated to the given graph. Note that the graph is not expected to be mo
  • getAllAncestorsInc
    Compute the set of inclusive ancestors of all vertices contained in the graph. The focused vertex wi
  • getAllRV
  • getAllRVInc
  • getRV
  • getWalkConstraint

Popular in Java

  • Reactive rest calls using spring rest template
  • startActivity (Activity)
  • putExtra (Intent)
  • getExternalFilesDir (Context)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • JCheckBox (javax.swing)
  • Top 17 Plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now