CPD Results

The following document contains the results of PMD's CPD 4.1.

Duplications

File Line
org/ctic/terras/MatcherOntModel.java 66
org/ctic/terras/MatcherSparqlModel.java 78
	    generator=new SparqlGenerator();
	    
	}
	
	private List<String> filterAnnotations(List<String> annotations){
		List<String> files=new LinkedList<String>();
		for(int i=0;i<annotations.size();i++){
			if(annotations.get(i).startsWith("@file")){
				String file=annotations.get(i).replaceAll("@file ", "");
				file=file.replaceAll("\r", "");
				files.add(file);
			}
		}
		return files;
	}
	
	public ResultTotalTO executeQuery(String queryString) throws Exception{
    	StringReader queryReader=new StringReader(queryString);
    	Yylex lex = new Yylex(queryReader);
    	return executeQuery(lex);
	}
	
	private ResultTotalTO executeQuery(Yylex lex) throws Exception{
		//System.out.println("Tamaņo: "+((Model)this.modelWrapper.getModel()).size());
		long start=System.currentTimeMillis();
		Parser parser = new Parser(lex, false);
    	parser.parse();
    	queryTO=(QuerySparqlTO)generator.visit(parser.getQuery());

File Line
org/ctic/terras/qil/syntactic/Parser.java 303
org/ctic/terras/qil/syntactic/Parser.java 308
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,  258,  259,   -1,

File Line
org/ctic/terras/MatcherSparqlEndpoint.java 90
org/ctic/terras/MatcherSparqlModel.java 109
		List<ResultTO> results=getResultsFromModel(queryTO);
		if(queryTO.getFrom()!=null){
			results = calculateLimits(queryTO, results);
		}
		long stop=System.currentTimeMillis();
		return new ResultTotalTO(results,stop-start,results.size());
	}

	private List<ResultTO> calculateLimits(QuerySparqlTO queryTO,
			List<ResultTO> results) {
		int f=queryTO.getFrom()>results.size()?results.size():queryTO.getFrom();
		if(queryTO.getTo()==null){
			results=results.subList(0, f);
		}else{
			int t=queryTO.getTo()>results.size()?results.size():queryTO.getTo();
			results=results.subList(f-1, t);
		}
		return results;
	}

File Line
org/ctic/terras/qil/syntactic/Parser.java 332
org/ctic/terras/qil/syntactic/Parser.java 336
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,"IDENTIFIER","URI_ABREV","URI","PREFIX",

File Line
org/ctic/terras/demands/filters/SimpleDataTypeFuntion.java 68
org/ctic/terras/demands/filters/SimpleDataTypeFuntion.java 85
		float statementValue=statement.getFloat();
		if(ExpressionDataProperty.EQUALS.equals(operator)){
			return statementValue==ivalue?1f:0; 
		}else if(ExpressionDataProperty.GREATER.equals(operator)){
			return statementValue>ivalue?1f:0;  
		}else if(ExpressionDataProperty.GREATER_EQUAL.equals(operator)){
			return statementValue>=ivalue?1f:0;  
		}else if(ExpressionDataProperty.LESSER.equals(operator)){
			return statementValue<ivalue?1f:0;  
		}else if(ExpressionDataProperty.LESSER_EQUAL.equals(operator)){
			return statementValue<=ivalue?1f:0;  
		}
		return 0f;
	}
	
	private Float compareString(Statement statement, String operator, String value){

File Line
org/ctic/terras/MatcherSparqlEndpoint.java 74
org/ctic/terras/MatcherSparqlModel.java 92
	}
	
	public ResultTotalTO executeQuery(String queryString) throws Exception{
    	StringReader queryReader=new StringReader(queryString);
    	Yylex lex = new Yylex(queryReader);
    	return executeQuery(lex);
	}
	
	private ResultTotalTO executeQuery(Yylex lex) throws Exception{
		//System.out.println("Tamaņo: "+((Model)this.modelWrapper.getModel()).size());
		long start=System.currentTimeMillis();
		Parser parser = new Parser(lex, false);
    	parser.parse();
    	queryTO=(QuerySparqlTO)generator.visit(parser.getQuery());
        Decision ahp = new DecisionAHP(queryTO.getWeights());
		queryTO.setWeights(ahp.calculateBalancedWeight());
		
		List<ResultTO> results=getResultsFromModel(queryTO);

File Line
org/ctic/terras/MatcherOntModel.java 103
org/ctic/terras/MatcherSparqlEndpoint.java 98
	private List<ResultTO> calculateLimits(QuerySparqlTO queryTO,
			List<ResultTO> results) {
		int f=queryTO.getFrom()>results.size()?results.size():queryTO.getFrom();
		if(queryTO.getTo()==null){
			results=results.subList(0, f);
		}else{
			int t=queryTO.getTo()>results.size()?results.size():queryTO.getTo();
			results=results.subList(f-1, t);
		}
		return results;
	}
	
	private List<ResultTO> getResults(QuerySparqlTO sparql) {

File Line
org/ctic/terras/qil/syntactic/Parser.java 270
org/ctic/terras/qil/syntactic/Parser.java 275
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,   14,   15,    0,

File Line
org/ctic/terras/MatcherOntModel.java 103
org/ctic/terras/MatcherSparqlModel.java 117
	private List<ResultTO> calculateLimits(QuerySparqlTO queryTO,
			List<ResultTO> results) {
		int f=queryTO.getFrom()>results.size()?results.size():queryTO.getFrom();
		if(queryTO.getTo()==null){
			results=results.subList(0, f);
		}else{
			int t=queryTO.getTo()>results.size()?results.size():queryTO.getTo();
			results=results.subList(f-1, t);
		}
		return results;
	}