Procházet zdrojové kódy

Merge remote-tracking branch 'msdl/main'

Joeri Exelmans před 2 roky
rodič
revize
0fea1203fa

+ 30 - 8
docs/federation_example.md

@@ -6,26 +6,48 @@
 
 ### Remote_0:
  
-- Fuseki instance
+- Fuseki instance (First and main SPARQL endpoint)
 
 ### Remote_1:
 
-- Heterogeneous data source vault (tabular)
+- Custom service SPARQL endpoint
 
 ### Remote_2:
 
+- Heterogeneous data source vault (tabular)
+
+### Remote_3:
+
 - Heterogeneous data source (other)
 
+## Example fuseki query
+
+![Drag Racing](fuseki_federated_query.png)
+
+Here we have the fuseki GUI as the client (**Local**).
+The Fuseki server is running at localhost:3030 (**Remote_0**).
+We then use a custom SPARQL endpoint to get outliers (**Remote_1**).
+This data is gathered from an API (**Remote_2**).
+We don't use the optional **Remote_3**.
+
 ## Visual
 
 ```mermaid
 sequenceDiagram
-    Local->>+Remote_1: SPARQL Query
-    Note over Local,Remote_1: TODO INSERT Query
+    Local->>+Remote_0: SPARQL Query
+    Note over Local,Remote_0: TODO INSERT Query
+    opt Remote data
+        Remote_0->>+Remote_1: SPARQL Data SubQuery
+        opt API call
+            Remote_1->>+Remote_2: Outlier service call
+            Remote_2-->>-Remote_1: Outlier data
+        end
+        Remote_1-->>-Remote_0: SubQuery Data
+    end
     opt Remote data
-        Remote_1->>+Remote_2: SPARQL Data SubQuery
-        Remote_2-->>-Remote_1: SubQuery Data
+        Remote_0->>+Remote_3: SPARQL Data SubQuery
+        Remote_3-->>-Remote_0: SubQuery Data
     end
-    Remote_1-->>-Local: Query Data
-    Note over Remote_1,Local: TODO INSERT Data
+    Remote_0-->>-Local: Query Data
+    Note over Remote_0,Local: TODO INSERT Data
 ```

binární
docs/fuseki_federated_query.png


+ 7 - 5
tools/typeOperations/src/main/java/ua/be/typeOperations/model/csv/operations/OutlierDetectionOperation.java

@@ -81,6 +81,8 @@ public class OutlierDetectionOperation implements Operation {
 
 	private String searchOutliers(List<CSVRecord> list, double sd, double average) {
 		StringBuilder sb = new StringBuilder();
+		sb.append("@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n");
+		sb.append("@prefix owl: <http://www.w3.org/2002/07/owl#> .\n");
 		int i = 1;
 		int rowN = 1;
 		for (CSVRecord row : list) {
@@ -89,11 +91,11 @@ public class OutlierDetectionOperation implements Operation {
 				sb.append("<" + artifactPrefix + instanceName + "-cell-" + rowN + "" + column + ">\n");
 				sb.append("\trdf:type "+ Prefixes.CELL_VOCABULARY_IRI + " , ");
 				sb.append(Prefixes.DATA_VOCABULARY_IRI + " , owl:Thing ;\n");
-				sb.append("\t"+Prefixes.TABULAR_VOCABULARY_IRI+ "hasColumnPosition " + column + " ;\n");
-				sb.append("\t"+Prefixes.TABULAR_VOCABULARY_IRI+ "hasRowPosition " + rowN + " ;\n");
-				sb.append("\t"+Prefixes.TABULAR_VOCABULARY_IRI+ "holdsContent \"" + value + "\" ;\n");
-				sb.append("\t"+Prefixes.TABULAR_VOCABULARY_IRI+ "isCellOfTabularData <" + artifactPrefix + instanceName + "> ;\n");
-				sb.append("\t"+Prefixes.TABULAR_VOCABULARY_IRI+ "isInCollection <" + artifactPrefix + instanceName + "-column-" + column + "> , ");
+				sb.append("\t"+Prefixes.TABULAR_VOCABULARY_IRI+ "hasColumnPosition> " + column + " ;\n");
+				sb.append("\t"+Prefixes.TABULAR_VOCABULARY_IRI+ "hasRowPosition> " + rowN + " ;\n");
+				sb.append("\t"+Prefixes.TABULAR_VOCABULARY_IRI+ "holdsContent> \"" + value + "\" ;\n");
+				sb.append("\t"+Prefixes.TABULAR_VOCABULARY_IRI+ "isCellOfTabularData> <" + artifactPrefix + instanceName + "> ;\n");
+				sb.append("\t"+Prefixes.TABULAR_VOCABULARY_IRI+ "isInCollection> <" + artifactPrefix + instanceName + "-column-" + column + "> , ");
 				sb.append("<" + artifactPrefix + instanceName + "-row-" + rowN + "> ;\n");
 				sb.append("\towl:sameAs <" + artifactPrefix + instanceName + "-cell-" + rowN + "" + column + "> .\n\n");
 				//sb.append("Outlier " + i++ + "  = " + value + " / in row = " + rowN + "\n");

+ 3 - 2
tools/typeOperations/src/main/resources/application.properties

@@ -1,3 +1,4 @@
+server.address = 0.0.0.0
 server.port = 9090
-management.endpoints.shutdown.enabled=true
-management.endpoint.info.enabled=true
+management.endpoints.shutdown.enabled = true
+management.endpoint.info.enabled = true