-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
324 additions
and
325 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package DataSet; | ||
|
||
/** | ||
* | ||
* @author aorogat | ||
*/ | ||
public class Benchmark { | ||
|
||
public final static int QALD_1 = 1; | ||
public final static int QALD_2 = 2; | ||
public final static int QALD_3 = 3; | ||
public final static int QALD_4 = 4; | ||
public final static int QALD_5 = 5; | ||
public final static int QALD_6 = 6; | ||
public final static int QALD_7 = 7; | ||
public final static int QALD_8 = 8; | ||
public final static int QALD_9 = 9; | ||
|
||
public final static int QALD_ALL = 100; | ||
public final static int LC_QUAD = 101; | ||
public final static int GraphQuestions = 102; | ||
public final static int WebQuestions = 103; | ||
public final static int SimpleQuestions = 104; | ||
public final static int SimpleDBpediaQA = 105; | ||
public final static int Free917 = 106; | ||
public final static int TempQuestions = 107; | ||
public final static int ComQA = 108; | ||
public final static int ComplexQuestions = 109; | ||
|
||
|
||
|
||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package ShapeAnalysis; | ||
|
||
import Graph.Edge; | ||
import java.util.Iterator; | ||
import org.apache.jena.query.Query; | ||
import org.apache.jena.sparql.core.TriplePath; | ||
import org.apache.jena.sparql.syntax.Element; | ||
import org.apache.jena.sparql.syntax.ElementPathBlock; | ||
import org.apache.jena.sparql.syntax.ElementSubQuery; | ||
import org.apache.jena.sparql.syntax.ElementVisitorBase; | ||
import org.apache.jena.sparql.syntax.ElementWalker; | ||
|
||
public class ElementVisitorShapeImpl extends ElementVisitorBase { | ||
|
||
static boolean subquery = false; | ||
|
||
@Override | ||
public void visit(ElementPathBlock el) { | ||
Iterator<TriplePath> triples = el.patternElts(); | ||
while (triples.hasNext()) { | ||
TriplePath triple = triples.next(); | ||
|
||
QueryShapeType.graph.edges.add(new Edge(triple.getSubject().toString(), triple.getObject().toString())); | ||
if (!QueryShapeType.graph.vertices.contains(triple.getSubject().toString())) { | ||
QueryShapeType.graph.vertices.add(triple.getSubject().toString()); | ||
} | ||
if (!QueryShapeType.graph.vertices.contains(triple.getObject().toString())) { | ||
QueryShapeType.graph.vertices.add(triple.getObject().toString()); | ||
} | ||
} | ||
} | ||
|
||
@Override | ||
public void visit(ElementSubQuery el) { | ||
subquery = true; | ||
Query q = el.getQuery(); | ||
Element e = q.getQueryPattern(); | ||
|
||
ElementVisitorBase visitor = new ElementVisitorShapeImpl(); | ||
ElementWalker.walk(e, visitor); | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.