true is returned, then {@link #compileToUnionQuery(ConjunctiveQuery)} will return
51 | * a non-null value.
52 | * @return
53 | */
54 | public boolean canCompileToUnionSPARQL();
55 |
56 | /**
57 | *
58 | * @return
59 | */
60 | public ConsistencyCheckResult computeConsistencyCheck();
61 | }
62 |
--------------------------------------------------------------------------------
/QueryEngine/QueryExpansion/src/com/ibm/research/owlql/rule/VariableExpr.java:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | * Copyright (c) 2015 IBM Corporation.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | *
8 | * Contributors:
9 | * IBM Corporation - initial API and implementation
10 | *****************************************************************************/
11 | package com.ibm.research.owlql.rule;
12 |
13 |
14 | /**
15 | * a variable
16 | * @author Achille Fokoue
17 | *
18 | */
19 | public class VariableExpr extends Expr{
20 |
21 |
22 | private String varName;
23 |
24 | public VariableExpr(String varName) {
25 | super();
26 | this.varName = varName;
27 | }
28 |
29 | @Override
30 | public boolean isConstant() {
31 | return false;
32 | }
33 | @Override
34 | public boolean isVariable() {
35 | return true;
36 | }
37 | public String getName() {
38 | return varName;
39 | }
40 |
41 | public void setName(String varName) {
42 | this.varName = varName;
43 | }
44 |
45 | @Override
46 | public ConstantExpr asConstant() {
47 | return null;
48 | }
49 |
50 | @Override
51 | public VariableExpr asVariable() {
52 | return this;
53 | }
54 |
55 | public boolean equals(Object o) {
56 | if (o==this) {
57 | return true;
58 | }
59 | if (o instanceof VariableExpr) {
60 | return varName.equals(((VariableExpr)o).getName());
61 | }
62 | return false;
63 | }
64 |
65 | public int hashCode() {
66 | return varName.hashCode();
67 | }
68 |
69 | public String toString() {
70 | return varName;
71 | }
72 |
73 | @Override
74 | public VariableExpr clone() {
75 | return new VariableExpr(varName);
76 | }
77 |
78 | }
79 |
--------------------------------------------------------------------------------
/QueryEngine/QueryExpansion/src/com/ibm/research/utils/SPARQLFileParser.java:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | * Copyright (c) 2015 IBM Corporation.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | *
8 | * Contributors:
9 | * IBM Corporation - initial API and implementation
10 | *****************************************************************************/
11 | package com.ibm.research.utils;
12 |
13 | import java.io.BufferedReader;
14 | import java.io.IOException;
15 | import java.io.Reader;
16 | import java.util.ArrayList;
17 | import java.util.List;
18 | import java.util.StringTokenizer;
19 |
20 |
21 |
22 | /**
23 | * Utitlies methods to read a file or an inputstream consisting of semicolon separated SPARQL queries.
24 | * @author achille
25 | *
26 | */
27 | public class SPARQLFileParser {
28 |
29 | /**
30 | * reads an input stream consisting of semicolon separated SPARQL queries, and returns the list of SPARQL
31 | * queries as strings.
32 | * @param ins
33 | * @return
34 | * @throws IOException
35 | */
36 | public static String[] readQueries(Reader ins) throws IOException {
37 |
38 | BufferedReader in = new BufferedReader(ins);
39 | StringBuffer buf = new StringBuffer();
40 | String line = null;
41 | while ((line=in.readLine())!=null) {
42 | if (!line.startsWith("#")) {
43 | buf.append(line+"\n");
44 | }
45 | }
46 | StringTokenizer t = new StringTokenizer(buf.toString(),";");
47 | Listnull to indicate that the consistency status depends of the content of the Abox. In this case,
48 | * the method {@link #getInconsistencyDetectionAskQuery()} will return the ask query that needs to be evaluated against an Abox to
49 | * ascertain its inconsistency *
50 | * true iff. A is inconsistent.
61 | * @return
62 | */
63 | public Query getInconsistencyDetectionAskQuery() {
64 | return inconsistencyDetectionAskQuery;
65 | }
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/QueryEngine/QueryExpansion/src/log4j.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 |
17 | # for production, you should probably set the root to INFO
18 | # and the pattern to %c instead of %l. (%l is slower.)
19 |
20 | # output messages into a rolling log file as well as stdout
21 | log4j.rootLogger=OFF,stdout
22 |
23 | # stdout
24 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender
25 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
26 | log4j.appender.stdout.layout.ConversionPattern=%5p %d{ISO8601} (%F:%L) %m%n
27 |
28 | # stdout
29 | #log4j.appender.stdout=org.apache.log4j.ConsoleAppender
30 | #log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
31 | #log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} %-5p <%t> [%c{1}] %m %n
32 |
33 | # rolling log file for Helix
34 | log4j.appender.R2=org.apache.log4j.RollingFileAppender
35 | log4j.appender.R2.maxFileSize=6MB
36 | log4j.appender.R2.maxBackupIndex=1
37 | log4j.appender.R2.layout=org.apache.log4j.PatternLayout
38 | log4j.appender.R2.layout.ConversionPattern=%5p %d{ISO8601} %m [%t -- %C (line %L)] %n
39 | # Edit the next line to point to your logs directory
40 | log4j.appender.R2.File=/tmp/DB2_RDF.log
41 | #log4j.logger.com.ibm.rdf.store.sparql11.stopt.LPPlanner=DEBUG,R2
42 | #log4j.logger.com.ibm.rdf.store.sparql11.stopt.lpplanner=INFO,R2
43 | #log4j.logger.com.ibm.rdf.store.sparql11.stopt.lpplanner.AndPatternInternalComponentView=ERROR,R2
44 | log4j.logger.com.ibm.rdf.store.sparql11.QueryProcessorImpl=DEBUG,R2
45 | log4j.logger.com.ibm.rdf.store.sparql11.DB2JazzQueryUtilityTest=INFO,R2
46 | # Helix classes to logger at a different level from DEBUG
47 | #log4j.logger.com.ibm.research.helix.rdb.RdbQueryProcessor=TRACE
48 |
49 | # Application logging options
50 | # We don't need to see DEBUG messages from Jena, HttpClient, or RDFParserRegistry
51 | log4j.logger.org.openrdf=WARN
52 | # Turn off all the annoying warnings about "String not in Unicode Normal Form"
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/QueryEngine/SPARQLToGremlin/pom.xml:
--------------------------------------------------------------------------------
1 |