Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/arces-wot/sepa.git
Browse files Browse the repository at this point in the history
  • Loading branch information
lroffia committed Nov 27, 2024
2 parents b333efb + 2d0be0c commit fbbdd20
Show file tree
Hide file tree
Showing 9 changed files with 110 additions and 16 deletions.
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
# docker build -t vaimeedock/sepa:v0.15.0 -t vaimeedock/sepa:latest .
# docker push vaimeedock/sepa --all-tag

FROM maven:latest AS build
FROM maven:3.6-jdk-11 AS build
COPY . .

RUN mvn clean package

FROM eclipse-temurin:latest
FROM openjdk:11.0-jre

COPY --from=build ./run.sh /run.sh
COPY --from=build ./engine/target/engine-1.0.0-SNAPSHOT.jar /engine.jar
Expand All @@ -25,11 +25,12 @@ COPY --from=build ./engine/src/main/resources/endpoints /endpoints
RUN chmod 600 /jmxremote.password
RUN chmod 777 /run.sh

ENV JMX_HOST=0.0.0.0
ENV JMX_PORT=7099
# MUST BE SET WITH THE HOST NAME (e.g. vaimee.com , vaimee.org, ...)
ENV JMX_HOSTNAME=0.0.0.0
ENV JMX_PORT=7999

EXPOSE ${JMX_PORT}
EXPOSE 8000
EXPOSE 9000
EXPOSE ${JMX_PORT}

ENTRYPOINT ["/run.sh"]
7 changes: 5 additions & 2 deletions client-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
<version>${revision}</version>
</parent>
<artifactId>client-api</artifactId>


<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down Expand Up @@ -52,5 +50,10 @@
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.23.1</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
import java.util.ArrayList;
import java.util.List;

import org.apache.logging.log4j.core.appender.rolling.action.IfAccumulatedFileCount;

import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.core.config.AppenderRef;
import org.apache.logging.log4j.core.config.Configuration;
import org.apache.logging.log4j.core.config.LoggerConfig;
import org.apache.logging.log4j.core.LoggerContext;


public class Logging {
public static final Logger logger = LogManager.getLogger();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,62 @@ private static JsonPrimitive getRequestBodyJSON(HttpRequest request) {
}

public static Map<String, Set<String>> splitQuery(String query) throws UnsupportedEncodingException {
Map<String, Set<String>> query_pairs = new LinkedHashMap<String, Set<String>>();
/*
* query (exactly 1)
* default-graph-uri (0 or more)
* named-graph-uri (0 or more)
*
* using-graph-uri (0 or more)
* using-named-graph-uri (0 or more)
* */
Map<String, Set<String>> query_pairs = new LinkedHashMap<String, Set<String>>();
int query_index = query.indexOf("query=");
int update_index = query.indexOf("update=");

int index = (query_index != -1 ? query_index : update_index);

int content_index = query.indexOf('=',index);
String keyString = URLDecoder.decode(query.substring(0, content_index), "UTF-8");
String valueString = URLDecoder.decode(query.substring(content_index + 1), "UTF-8");
if (!query_pairs.containsKey(keyString)) query_pairs.put(keyString, new HashSet<String>());
query_pairs.get(keyString).add(valueString);

/*int default_graph_uri_index = query.indexOf("default-graph-uri=");
int named_graph_uri_index = query.indexOf("named-graph-uri=");
int using_graph_uri_index = query.indexOf("using-graph-uri=");
int using_named_graph_uri_index = query.indexOf("using-named-graph-uri=");
if (query_index!=-1) {
int query_content_index = query.indexOf('=',query_index);
if (default_graph_uri_index==-1 && named_graph_uri_index==-1) {
String keyString = URLDecoder.decode(query.substring(0, query_content_index), "UTF-8");
String valueString = URLDecoder.decode(query.substring(query_content_index + 1), "UTF-8");
if (!query_pairs.containsKey(keyString)) query_pairs.put(keyString, new HashSet<String>());
query_pairs.get(keyString).add(valueString);
} else if (default_graph_uri_index!=-1 && named_graph_uri_index==-1){
if (default_graph_uri_index > query_index) {
}
else {
}
} else if (default_graph_uri_index==-1 && named_graph_uri_index!=-1) {
} else {
}
}
String[] pairs = query.split("&");
for (String pair : pairs) {
int idx = pair.indexOf("=");
String keyString = URLDecoder.decode(pair.substring(0, idx), "UTF-8");
String valueString = URLDecoder.decode(pair.substring(idx + 1), "UTF-8");
if (!query_pairs.containsKey(keyString)) query_pairs.put(keyString, new HashSet<String>());
query_pairs.get(keyString).add(valueString);
}
}*/
return query_pairs;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,11 @@ protected InternalUQRequest parse(HttpAsyncExchange exchange, ClientAuthorizatio
*
* <pre>
*
* HTTP Method Query String Parameters Request | Content Type Request Message Body
* | HTTP Method | Query String Parameters | Request Content Type | Request Message Body
* ----------------------------------------------------------------------------------------------------------------------------------------
* query via GET | GET | query (exactly 1) | None | None | default-graph-uri (0 or more) named-graph-uri (0 or more)
* query via GET | GET | query (exactly 1) | None | None
* | default-graph-uri (0 or more)
* | named-graph-uri (0 or more)
*
* 2.1.4 Specifying an RDF Dataset
*
Expand Down
33 changes: 33 additions & 0 deletions engine/src/main/resources/endpoints/virtuoso-dld.jpar
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"host": "dld.arces.unibo.it",
"oauth": {
"enable": false,
"register": "https://localhost:8443/oauth/register",
"tokenRequest": "https://localhost:8443/oauth/token",
"client_id": "",
"client_secret": "",
"jwt": "",
"expires": "",
"type": ""
},
"graphs": {
"default-graph-uri": "http://default",
"named-graph-uri": "http://default",
"using-graph-uri": "http://default",
"using-named-graph-uri": "http://default"
},
"sparql11protocol": {
"protocol": "http",
"port": 8890,
"query": {
"path": "/sparql",
"method": "URL_POST_ENCODED",
"format": "JSON"
},
"update": {
"path": "/sparql",
"method": "POST",
"format": "JSON"
}
}
}
9 changes: 9 additions & 0 deletions logging-jconsole.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
handlers=java.util.logging.ConsoleHandler

.level=ALL
java.util.logging.ConsoleHandler.level=ALL
#java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
javax.management.level=ALL
javax.management.remote.level=ALL

# usage: jconsole -J-Djava.util.logging.config.file=logging-jconsole.properties
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,12 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.20.0</version>
<version>2.23.1</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.20.0</version>
<version>2.23.1</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
Expand Down

0 comments on commit fbbdd20

Please sign in to comment.