Skip to content

Commit

Permalink
Merge branch 'version4' of https://github.com/ontop/ontop into version4
Browse files Browse the repository at this point in the history
# Conflicts:
#	test/sparql-compliance/pom.xml
  • Loading branch information
LorenzBuehmann committed Dec 29, 2020
2 parents 64c9553 + f74ab91 commit c32ed68
Show file tree
Hide file tree
Showing 740 changed files with 22,951 additions and 19,500 deletions.
34 changes: 1 addition & 33 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,6 @@
# How to contribute to Ontop

## General Questions and Discussion

We have a Google group for anything related to support, discussion and announcements. Please join for any inquiry.

ontop4obda AT googlegroups DOT com

## Bug report

1. First check if you are using the latest version of Ontop
2. If you are sure you find a bug, use GitHub Issues to submit the report; otherwise, you may want to use the mail list for the discussion.
3. When reporting a bug, please provide a minimal use case if possible.


## Contributing Code

Do you know how to fix something or provide new features?

For trivial contribution (e.g. fixing typos in the docs), please use the Pull Request of GitHub.

For non-trivial contribution, please contact us first. Contributions to the project are welcome and encouraged. The
contributor should sign a Contribution License Agreement (CLA) that
allows FUB and the ontop team to redistribute their work under the
terms of the Apache 2.0 license. If the contributor works for an
institution that owns the work being contributed by the contributor,
then a corporate CLA must be additionally signed. The CLAs are
available for download bellow, once signed please FAX or email a
scanned copy of them to the ontop team.


* [Individual Contributor License Agreement (CLA)](https://raw.github.com/ontop/ontop/master/documentation/ontop-cla-2013-11-04.txt)
* [Corporate License Agreement](https://raw.github.com/ontop/ontop/master/documentation/ontop-cla-corporate-2013-11-04.txt)

If you have any questions, please contact the ontop team.
Please visit https://ontop-vkg.org/community/contributing/ for the guidelines.



11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "maven" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
117 changes: 117 additions & 0 deletions .mvn/wrapper/MavenWrapperDownloader.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
/*
* Copyright 2007-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.net.*;
import java.io.*;
import java.nio.channels.*;
import java.util.Properties;

public class MavenWrapperDownloader {

private static final String WRAPPER_VERSION = "0.5.6";
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";

/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
".mvn/wrapper/maven-wrapper.properties";

/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
".mvn/wrapper/maven-wrapper.jar";

/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";

public static void main(String args[]) {
System.out.println("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());

// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if(mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
} catch (IOException e) {
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if(mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: " + url);

File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if(!outputFile.getParentFile().exists()) {
if(!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
}
}

private static void downloadFileFromURL(String urlString, File destination) throws Exception {
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
String username = System.getenv("MVNW_USERNAME");
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
}
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
}

}
Binary file modified .mvn/wrapper/maven-wrapper.jar
100755 → 100644
Binary file not shown.
3 changes: 2 additions & 1 deletion .mvn/wrapper/maven-wrapper.properties
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ language: java

jdk:
- openjdk8

- openjdk11

services:
- docker

Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
| Branch | build status |
|-----------|---------------|
| [master](https://github.com/ontop/ontop/tree/master) |[![Build Status](https://travis-ci.org/ontop/ontop.svg?branch=master)](https://travis-ci.org/ontop/ontop)|
| [version3](https://github.com/ontop/ontop/tree/version3) |[![Build Status](https://travis-ci.org/ontop/ontop.svg?branch=version3)](https://travis-ci.org/ontop/ontop)|
| [version4](https://github.com/ontop/ontop/tree/version4) |[![Build Status](https://travis-ci.org/ontop/ontop.svg?branch=version4)](https://travis-ci.org/ontop/ontop)|


Expand All @@ -23,7 +22,7 @@ Compiling, packing, testing, etc.

The project is a [Maven](http://maven.apache.org/) project. Compiling,
running the unit tests, building the release binaries all can be done
using maven. Currently we use Maven 3 and Java 8 to build the
using maven. Currently, we use Maven 3 and Java 8 to build the
project.


Expand Down
11 changes: 0 additions & 11 deletions binding/owlapi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@
<artifactId>owlapi-apibinding</artifactId>
</dependency>

<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>ontop-system-sql-owlapi</artifactId>
Expand All @@ -58,12 +53,6 @@
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-queryparser-sparql</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,5 @@
package it.unibz.inf.ontop.owlapi.connection.impl;

/*
* #%L
* ontop-quest-owlapi
* %%
* Copyright (C) 2009 - 2014 Free University of Bozen-Bolzano
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/

import it.unibz.inf.ontop.answering.reformulation.input.*;
import it.unibz.inf.ontop.exception.*;
import it.unibz.inf.ontop.answering.resultset.BooleanResultSet;
Expand All @@ -36,6 +16,8 @@
import it.unibz.inf.ontop.owlapi.resultset.impl.OntopGraphOWLResultSet;
import it.unibz.inf.ontop.owlapi.resultset.impl.OntopBooleanOWLResultSet;

import java.security.SecureRandom;

/***
* A Statement to execute queries over a QuestOWLConnection. The logic of this
* statement is equivalent to that of JDBC's Statements.
Expand Down Expand Up @@ -84,13 +66,22 @@ public TupleOWLResultSet executeSelectQuery(String inputQuery) throws OntopOWLEx
SelectQuery query = inputQueryFactory.createSelectQuery(inputQuery);
TupleResultSet resultSet = st.execute(query);

return new OntopTupleOWLResultSet(resultSet);


return new OntopTupleOWLResultSet(resultSet, generateSalt());

} catch (OntopQueryEngineException e) {
throw new OntopOWLException(e);
}
}

private byte[] generateSalt() {
SecureRandom random = new SecureRandom();
byte[] salt = new byte[20];
random.nextBytes(salt);
return salt;
}

@Override
public BooleanOWLResultSet executeAskQuery(String inputQuery) throws OntopOWLException {
try {
Expand Down Expand Up @@ -139,7 +130,7 @@ private GraphOWLResultSet executeGraph(GraphSPARQLQuery query)
OntopResultConversionException {

SimpleGraphResultSet resultSet = st.execute(query);
return new OntopGraphOWLResultSet(resultSet);
return new OntopGraphOWLResultSet(resultSet, generateSalt());
}

public int getMaxRows() throws OntopOWLException {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,5 @@
package it.unibz.inf.ontop.owlapi.impl;

/*
* #%L
* ontop-quest-owlapi
* %%
* Copyright (C) 2009 - 2014 Free University of Bozen-Bolzano
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/

import com.google.common.collect.ImmutableSet;
import it.unibz.inf.ontop.answering.resultset.MaterializedGraphResultSet;
import it.unibz.inf.ontop.exception.OBDASpecificationException;
Expand All @@ -37,6 +17,7 @@
import org.semanticweb.owlapi.model.OWLException;

import javax.annotation.Nonnull;
import java.security.SecureRandom;

public class DefaultOntopOWLAPIMaterializer implements OntopOWLAPIMaterializer {

Expand Down Expand Up @@ -95,6 +76,9 @@ public ImmutableSet<IRI> getProperties() {
}

private MaterializedGraphOWLResultSet wrap(MaterializedGraphResultSet graphResultSet) {
return new OntopMaterializedGraphOWLResultSet(graphResultSet);
SecureRandom random = new SecureRandom();
byte[] salt = new byte[20];
random.nextBytes(salt);
return new OntopMaterializedGraphOWLResultSet(graphResultSet, salt);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
import org.semanticweb.owlapi.model.OWLPropertyAssertionObject;

import java.util.Iterator;
import java.util.List;
import java.util.Set;

public interface OWLBindingSet extends Iterable<OWLBinding> {

@Override
Iterator<OWLBinding> iterator();

List<String> getBindingNames() throws OWLException;
Set<String> getBindingNames() throws OWLException;

OWLBinding getBinding(String bindingName) throws OWLException;

Expand Down
Loading

0 comments on commit c32ed68

Please sign in to comment.