Skip to content

Commit

Permalink
Merge pull request #90 from xgaia/release_3.2.4
Browse files Browse the repository at this point in the history
Release 3.2.4
  • Loading branch information
xgaia committed Jan 22, 2020
2 parents 9253dd4 + bbeecad commit 3db1a58
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ matrix:
- docker pull askomics/virtuoso:7.2.5.1
- docker pull bgruening/galaxy-stable:19.01
- docker pull xgaia/corese:latest
- docker pull xgaia/isql-api:2.1.0
- docker pull xgaia/isql-api:2.1.1
- sudo docker run -d --name virtuoso -p 8891:8890 -p 1112:1111 -e DBA_PASSWORD=dba -e SPARQL_UPDATE=true -e DEFAULT_GRAPH=http://localhost:8891/DAV -t askomics/virtuoso:7.2.5.1 /bin/sh -c "netstat -nr | grep '^0\.0\.0\.0' | grep -oE '((1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\.){3}(1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])' | grep -v '^0\.0\.0\.0' | sed 's/$/ askomics-host/' >> /etc/hosts && /virtuoso/virtuoso.sh"
- sleep 1m
- sudo docker run -d --name redis -p 6380:6379 -t redis:4.0
- sudo docker run -d --name galaxy -p 8081:80 -t bgruening/galaxy-stable:19.01
- sudo docker run -d --name corese -p 8082:8080 -t xgaia/corese:latest /bin/sh -c "netstat -nr | grep '^0\.0\.0\.0' | grep -oE '((1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\.){3}(1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])' | grep -v '^0\.0\.0\.0' | sed 's/$/ askomics-host/' >> /etc/hosts && /corese/start.sh"
- sudo docker run -d --name isql-api -p 5051:5050 -e VIRTUOSO_HOST=askomics-host -e VIRTUOSO_ISQL_PORT=1112 -t xgaia/isql-api:2.1.0 /bin/sh -c "netstat -nr | grep '^0\.0\.0\.0' | grep -oE '((1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\.){3}(1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])' | grep -v '^0\.0\.0\.0' | sed 's/$/ askomics-host/' >> /etc/hosts && sh /isqlapi/docker-run.sh"
- sudo docker run -d --name isql-api -p 5051:5050 -e VIRTUOSO_HOST=askomics-host -e VIRTUOSO_ISQL_PORT=1112 -t xgaia/isql-api:2.1.1 /bin/sh -c "netstat -nr | grep '^0\.0\.0\.0' | grep -oE '((1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\.){3}(1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])' | grep -v '^0\.0\.0\.0' | sed 's/$/ askomics-host/' >> /etc/hosts && sh /isqlapi/docker-run.sh"
- sleep 1m
script:
- flake8 askomics tests --ignore=E501,W504
- pytest --cov=. -vv --log-cli-level debug
- pytest --cov=. -vv
after_success:
coveralls

Expand Down
2 changes: 1 addition & 1 deletion askomics/libaskomics/SparqlQueryBuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def toggle_public(self, graph, public):
'''.format(graph=graph, public=public)

query_launcher = SparqlQueryLauncher(self.app, self.session)
query_launcher.execute_query(self.prefix_query(query), no_isql=True)
query_launcher.execute_query(self.prefix_query(query))

def get_default_query_with_prefix(self):
"""Get default query with the prefixes
Expand Down
20 changes: 10 additions & 10 deletions askomics/libaskomics/SparqlQueryLauncher.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def insert_data(self, ttl, graph, metadata=False):
}}
'''.format(graph, triples)

return self.execute_query(query, no_isql=True)
return self.execute_query(query)

def drop_dataset(self, graph):
"""Drop the datasets of the triplestore and its metadata
Expand All @@ -243,9 +243,9 @@ def drop_dataset(self, graph):
query = '''
DROP SILENT GRAPH <{}>
'''.format(graph)
self.execute_query(query, disable_log=True)
self.execute_query(query, disable_log=True, isql_api=True)

def process_query(self, query, no_isql=False):
def process_query(self, query, isql_api=False):
"""Execute a query and return parsed results
Parameters
Expand All @@ -258,9 +258,9 @@ def process_query(self, query, no_isql=False):
list
Parsed results
"""
return self.parse_results(self.execute_query(query, no_isql=False))
return self.parse_results(self.execute_query(query, isql_api=isql_api))

def execute_query(self, query, disable_log=False, no_isql=False):
def execute_query(self, query, disable_log=False, isql_api=False):
"""Execute a sparql query
Parameters
Expand All @@ -274,15 +274,15 @@ def execute_query(self, query, disable_log=False, no_isql=False):
result
"""
try:
triplestore = self.settings.get("triplestore", "triplestore")

# Use ISQL or SPARQL
triplestore = self.settings.get("triplestore", "triplestore")
isqlapi = None
isql_api_url = None
try:
isqlapi = self.settings.get("triplestore", "isqlapi")
isql_api_url = self.settings.get("triplestore", "isqlapi")
except Exception:
pass
use_isql = True if triplestore == "virtuoso" and isqlapi and self.local_query and not no_isql else False
use_isql = True if triplestore == "virtuoso" and isql_api_url and self.local_query and isql_api else False

start_time = time.time()
self.endpoint.setQuery(query)
Expand All @@ -295,7 +295,7 @@ def execute_query(self, query, disable_log=False, no_isql=False):
if use_isql:
formatted_query = "SPARQL {}".format(query)
json = {"command": formatted_query, "disable_log": disable_log, "sparql_select": not self.endpoint.isSparqlUpdateRequest()}
response = requests.post(url=isqlapi, json=json)
response = requests.post(url=isql_api_url, json=json)
results = response.json()
if results["status"] == 500:
raise HTTPError("isqlapi: {}".format(results["message"]))
Expand Down
4 changes: 2 additions & 2 deletions askomics/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def query(self, session, info):
results = []
if query_builder.graphs:
query_launcher = SparqlQueryLauncher(app, session, get_result_query=True, federated=federated, endpoints=endpoints)
headers, results = query_launcher.process_query(query)
headers, results = query_launcher.process_query(query, isql_api=True)

# write result to a file
file_size = result.save_result_in_file(headers, results)
Expand Down Expand Up @@ -215,7 +215,7 @@ def sparql_query(self, session, info):
result.update_db_status("started", update_celery=True)

query_launcher = SparqlQueryLauncher(app, session, get_result_query=True, federated=info["federated"], endpoints=info["endpoints"])
header, data = query_launcher.process_query(info["sparql_query"])
header, data = query_launcher.process_query(info["sparql_query"], isql_api=True)

# Write results in file
file_size = result.save_result_in_file(header, data)
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"ontology"
],
"name": "AskOmics",
"version": "3.2.3",
"version": "3.2.4",
"description": "Visual SPARQL query builder",
"author": "Xavier Garnier",
"license": "AGPL-3.0",
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name='askomics',
version='3.2.3',
version='3.2.4',
description='''
AskOmics is a visual SPARQL query interface supporting both intuitive
data integration and querying while shielding the user from most of the
Expand Down

0 comments on commit 3db1a58

Please sign in to comment.