test_class.declarator: helper = new SparqlTranslationHelper()
test_class.modifier: private final
test_class.original_string: private final SparqlTranslationHelper helper = new SparqlTranslationHelper();
test_class.type: SparqlTranslationHelper
test_class.var_name: helper
test_class.file: recommendation-servlet/src/test/java/org/sindice/analytics/queryProcessor/TestSparqlTranslationProcessor.java
test_class.identifier: TestSparqlTranslationProcessor
test_case.body: @Test
    public void testTranslateClassTriplePattern()
    throws Exception {
      final String query = "SELECT * { ?s a <Person> . }";
      final ASTQueryContainer ast = SyntaxTreeBuilder.parseQuery(query);
      final RecommendationQuery actual = SparqlTranslationProcessor.process(null, ast);
      final RecommendationQuery rq = new RecommendationQuery(DataGraphSummaryVocab.GRAPH_SUMMARY_GRAPH, null);
  
      rq.type().add(new Type(null, "s", "<Person>"));
  
      helper.assertDGSQuery(rq, actual);
    }
test_case.class_method_signature: TestSparqlTranslationProcessor.testTranslateClassTriplePattern()
test_case.full_signature: @Test public void testTranslateClassTriplePattern()
test_case.identifier: testTranslateClassTriplePattern
test_case.invocations: parseQuery process add type assertDGSQuery
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testTranslateClassTriplePattern()
focal_class.declarator: isLeaf = new IsLeaf()
focal_class.modifier: private final static
focal_class.original_string: private final static IsLeaf      isLeaf = new IsLeaf();
focal_class.type: IsLeaf
focal_class.var_name: isLeaf
focal_class.declarator: astQueryContainer
focal_class.modifier: private static
focal_class.original_string: private static ASTQueryContainer astQueryContainer;
focal_class.type: ASTQueryContainer
focal_class.var_name: astQueryContainer
focal_class.file: recommendation-servlet/src/main/java/org/sindice/analytics/queryProcessor/SparqlTranslationProcessor.java
focal_class.identifier: SparqlTranslationProcessor
focal_class.class_method_signature: SparqlTranslationProcessor.SparqlTranslationProcessor()
focal_class.full_signature: private  SparqlTranslationProcessor()
focal_class.identifier: SparqlTranslationProcessor
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  SparqlTranslationProcessor()
focal_class.class_method_signature: SparqlTranslationProcessor.process(POFMetadata meta, ASTQueryContainer ast)
focal_class.full_signature: public static RecommendationQuery process(POFMetadata meta, ASTQueryContainer ast)
focal_class.identifier: process
focal_class.modifiers: public static
focal_class.parameters: (POFMetadata meta, ASTQueryContainer ast)
focal_class.return: RecommendationQuery
focal_class.signature: RecommendationQuery process(POFMetadata meta, ASTQueryContainer ast)
focal_class.class_method_signature: SparqlTranslationProcessor.changeToPofResource(RecommendationQuery rq, String pofResourceName)
focal_class.full_signature: private static void changeToPofResource(RecommendationQuery rq, String pofResourceName)
focal_class.identifier: changeToPofResource
focal_class.modifiers: private static
focal_class.parameters: (RecommendationQuery rq, String pofResourceName)
focal_class.return: void
focal_class.signature: void changeToPofResource(RecommendationQuery rq, String pofResourceName)
focal_method.body: public static RecommendationQuery process(POFMetadata meta, ASTQueryContainer ast)
    throws MalformedQueryException, VisitorException {
      // replace any dataset URI (graph and FROM) by their second-level domain name
      final Dataset datasets = DatasetDeclProcessor.process(ast);
      final ASTIRI d;
  
      astQueryContainer = ast;
      if (datasets != null) {
        if (!datasets.getDefaultGraphs().isEmpty() || !datasets.getNamedGraphs().isEmpty()) {
          if (!datasets.getDefaultGraphs().isEmpty() && !datasets.getNamedGraphs().isEmpty()) {
            throw new DGSException("There can be only one default/named graph");
          }
          if (!datasets.getDefaultGraphs().isEmpty() && datasets.getDefaultGraphs().size() != 1) {
            throw new DGSException("There can be only one default/named graph");
          }
          if (!datasets.getNamedGraphs().isEmpty() && datasets.getNamedGraphs().size() != 1) {
            throw new DGSException("There can be only one default/named graph");
          }
        }
        if (!datasets.getDefaultGraphs().isEmpty() && datasets.getNamedGraphs().isEmpty()) {
          d = new ASTIRI(SyntaxTreeBuilderTreeConstants.JJTIRI);
          final String value = datasets.getDefaultGraphs().toArray(new URI[1])[0].stringValue();
          d.setValue(URIUtil.getSndDomainFromUrl(value));
        } else if (datasets.getDefaultGraphs().isEmpty() && !datasets.getNamedGraphs().isEmpty()) {
          d = new ASTIRI(SyntaxTreeBuilderTreeConstants.JJTIRI);
          final String value = datasets.getNamedGraphs().toArray(new URI[1])[0].stringValue();
          d.setValue(URIUtil.getSndDomainFromUrl(value));
        } else {
          d = null;
        }
      } else {
        d = null;
      }
  
      String filter = null;
      if (meta != null && meta.pofNode.getMetadata() != null) {
        final Object keyword = meta.pofNode.getMetadata(SyntaxTreeBuilder.Keyword);
        final Object prefix = meta.pofNode.getMetadata(SyntaxTreeBuilder.Prefix);
        final Object qname = meta.pofNode.getMetadata(SyntaxTreeBuilder.Qname);
  
        if (keyword != null) {
          filter = "regex(str(?" + SyntaxTreeBuilder.PointOfFocus + "), \"" + keyword + "\", \"i\")";
        } else if (prefix != null) {
          filter = "regex(str(?" + SyntaxTreeBuilder.PointOfFocus + "), \"^" + prefix + "\", \"i\")";
        } else if (qname != null) {
          filter = "regex(str(?" + SyntaxTreeBuilder.PointOfFocus + "), \"^" + qname + "\", \"i\")";
        }
      }
  
      final RecommendationQuery rq = new RecommendationQuery(DataGraphSummaryVocab.GRAPH_SUMMARY_GRAPH, filter);
      final SparqlTranslationVisitor v = new SparqlTranslationVisitor(rq, d);
  
      v.visit(ast, null);
      // Change variable name of the POF ressource
      changeToPofResource(rq, v.pofResourceName);
      return rq;
    }
focal_method.class_method_signature: SparqlTranslationProcessor.process(POFMetadata meta, ASTQueryContainer ast)
focal_method.full_signature: public static RecommendationQuery process(POFMetadata meta, ASTQueryContainer ast)
focal_method.identifier: process
focal_method.invocations: process isEmpty getDefaultGraphs isEmpty getNamedGraphs isEmpty getDefaultGraphs isEmpty getNamedGraphs isEmpty getDefaultGraphs size getDefaultGraphs isEmpty getNamedGraphs size getNamedGraphs isEmpty getDefaultGraphs isEmpty getNamedGraphs stringValue toArray getDefaultGraphs setValue getSndDomainFromUrl isEmpty getDefaultGraphs isEmpty getNamedGraphs stringValue toArray getNamedGraphs setValue getSndDomainFromUrl getMetadata getMetadata getMetadata getMetadata visit changeToPofResource
focal_method.modifiers: public static
focal_method.parameters: (POFMetadata meta, ASTQueryContainer ast)
focal_method.return: RecommendationQuery
focal_method.signature: RecommendationQuery process(POFMetadata meta, ASTQueryContainer ast)