congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
QueryTransformOps.shallowCopy
Code IndexAdd Tabnine to your IDE (free)

How to use
shallowCopy
method
in
org.apache.jena.sparql.syntax.syntaxtransform.QueryTransformOps

Best Java code snippets using org.apache.jena.sparql.syntax.syntaxtransform.QueryTransformOps.shallowCopy (Showing top 2 results out of 315)

origin: apache/jena

private static void testShallowCopy(String queryString)
{
  Query q1 = QueryFactory.create(queryString) ;
  Query q2 = QueryTransformOps.shallowCopy(q1) ;
  assertEquals(q1, q2) ;
}
origin: apache/jena

/** Transform a query using {@link ElementTransform} and {@link ExprTransform}.
 *  It is the responsibility of these transforms to transform to a legal SPARQL query.
 */ 
public static Query transform(Query query, ElementTransform transform, ExprTransform exprTransform) {
  Query q2 = QueryTransformOps.shallowCopy(query);
  // "Shallow copy with transform."
  transformVarExprList(q2.getProject(), exprTransform);
  transformVarExprList(q2.getGroupBy(), exprTransform);
  transformExprList(q2.getHavingExprs(), exprTransform);
  if (q2.getOrderBy() != null) {
    transformSortConditions(q2.getOrderBy(), exprTransform);
  }
  // ?? DOES NOT WORK: transformExprListAgg(q2.getAggregators(), exprTransform) ; ??
  // if ( q2.hasHaving() ) {}
  // if ( q2.hasAggregators() ) {}
  Element el = q2.getQueryPattern();
  Element el2 = ElementTransformer.transform(el, transform, exprTransform);
  // Top level is always a group.
  if (!(el2 instanceof ElementGroup)) {
    ElementGroup eg = new ElementGroup();
    eg.addElement(el2);
    el2 = eg;
  }
  q2.setQueryPattern(el2);
  return q2;
}
org.apache.jena.sparql.syntax.syntaxtransformQueryTransformOpsshallowCopy

Popular methods of QueryTransformOps

  • transform
    Transform a query using ElementTransform and ExprTransform. It is the responsibility of these transf
  • transformExprList
  • transformQuery
    Transform a query based on a mapping from variable name to replacement RDFNode (a Resource (or blank
  • transformSortConditions
  • transformVarExprList

Popular in Java

  • Reactive rest calls using spring rest template
  • getContentResolver (Context)
  • setContentView (Activity)
  • onRequestPermissionsResult (Fragment)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • BoxLayout (javax.swing)
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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