Codota Logo
TriplePattern.variantOf
Code IndexAdd Codota to your IDE (free)

How to use
variantOf
method
in
com.hp.hpl.jena.reasoner.TriplePattern

Best Java code snippets using com.hp.hpl.jena.reasoner.TriplePattern.variantOf (Showing top 1 results out of 315)

  • Common ways to obtain TriplePattern
private void myMethod () {
TriplePattern t =
  • Codota IconNode subject;Node predicate;Node object;new TriplePattern(subject, predicate, object)
  • Smart code suggestions by Codota
}
origin: org.apache.clerezza.ext/org.apache.jena.jena-core

/**
 * Test if a pattern is just a variant of this pattern. I.e. it is the same
 * up to variable renaming. This takes into account multiple occurances
 * of the same variable.
 */
public boolean variantOf(TriplePattern pattern) {
  Map<Node, Node> vmap = CollectionFactory.createHashedMap();
  if ( ! variantOf(subject, pattern.subject, vmap) ) return false;
  if ( ! variantOf(predicate, pattern.predicate, vmap) ) return false;
  if (Functor.isFunctor(object) && Functor.isFunctor(pattern.object)) {
    Functor functor = (Functor)object.getLiteralValue();
    Functor pFunctor = (Functor)pattern.object.getLiteralValue();
    if ( ! functor.getName().equals(pFunctor.getName()) ) return false;
    Node[] args = functor.getArgs();
    Node[] pargs = pFunctor.getArgs();
    if ( args.length != pargs.length ) return false;
    for (int i = 0; i < args.length; i++) {
      if ( ! variantOf(args[i], pargs[i], vmap) ) return false;
    }
    return true; 
  } else {
    return variantOf(object, pattern.object, vmap);
  } 
}

com.hp.hpl.jena.reasonerTriplePatternvariantOf

Javadoc

Test if one node is a variant of another give a table of variable matches.

Popular methods of TriplePattern

  • <init>
    Constructor - builds a pattern from a standard triple match. Node that any filter part of the triple
  • getObject
    Returns the object.
  • getPredicate
    Returns the predicate.
  • getSubject
    Returns the subject.
  • asTriple
    Return the triple pattern as a triple
  • asTripleMatch
    Return the triple pattern as a triple match
  • compatibleWith
    Compare two patterns for compatibility - i.e. potentially unifiable. Two patterns are "compatible" i
  • isGround
    Test if the pattern is ground, contains no variables.
  • nodeEqual
    Helper - equality override on nodes
  • normalize
    Convert any null wildcards to Node_RuleVariable wildcards.
  • simplePrintString
    Simplified printable name for a triple
  • toMatch
    Convert any Node_RuleVariable wildcards to null. This loses the variable named but is used when conv
  • simplePrintString,
  • toMatch

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getApplicationContext (Context)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • setContentView (Activity)
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Timer (java.util)
    A facility for threads to schedule tasks for future execution in a background thread. Tasks may be s
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now