wikipunk commited on
Commit
eed4206
1 Parent(s): a3de7e3

add sparql query and compressed dataset

Browse files
Files changed (4) hide show
  1. README.md +10 -0
  2. d3fend.nt.gz +3 -0
  3. d3fend.owl.gz +3 -0
  4. d3fend.rq +41 -0
README.md CHANGED
@@ -20,3 +20,13 @@ information: https://www.michaeldebellis.com/post/export-inferred-axioms.
20
  Once you have the materialized ontology you can filter it with
21
  d3fend.sparql.
22
 
 
 
 
 
 
 
 
 
 
 
 
20
  Once you have the materialized ontology you can filter it with
21
  d3fend.sparql.
22
 
23
+ ``` shell
24
+ arq --query=d3fend.rq --data=d3fend.owl --results=turtle > d3fend.ttl
25
+ ```
26
+
27
+ ``` shell
28
+ riot --output=nt d3fend.ttl > d3fend.nt
29
+ ```
30
+
31
+ The d3fend.owl and d3fend.nt files then are compressed using gzip.
32
+
d3fend.nt.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:167cacf0006b792d94c8eb39b7ed032cdcd4c761c2c1f436daaa2402c0c618f4
3
+ size 1891369
d3fend.owl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fb9b392a539f1198f816c1250518c8e1f5058694d1c5cc6f9244379147646ca5
3
+ size 4504462
d3fend.rq ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ PREFIX d3f: <http://d3fend.mitre.org/ontologies/d3fend.owl#>
2
+ PREFIX dcterms: <http://purl.org/dc/terms/>
3
+ PREFIX owl: <http://www.w3.org/2002/07/owl#>
4
+ PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
5
+ PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
6
+ PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
7
+ PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
8
+
9
+ CONSTRUCT {
10
+ ?s ?p ?new_o .
11
+ }
12
+ WHERE {
13
+ ?s ?p ?o .
14
+
15
+ # Transform rdfs:seeAlso strings that are valid QNames into URIs
16
+ BIND(
17
+ IF(
18
+ ?p = rdfs:seeAlso && isLiteral(?o) && REGEX(STR(?o), "^d3f:([a-zA-Z_][a-zA-Z0-9_]*)$"),
19
+ URI(REPLACE(STR(?o), "^d3f:", STR(d3f:))),
20
+ ?o
21
+ ) AS ?new_o
22
+ )
23
+
24
+ FILTER (?p NOT IN (
25
+ d3f:d3fend-data-property,
26
+ d3f:d3fend-kb-data-property,
27
+ d3f:d3fend-kb-object-property,
28
+ d3f:d3fend-object-property,
29
+ d3f:todo
30
+ )
31
+ )
32
+
33
+ FILTER (
34
+ !isLiteral(?new_o) || (isLiteral(?new_o) && STRLEN(STR(?new_o)) > 0)
35
+ )
36
+
37
+ FILTER (
38
+ !(?p = rdfs:seeAlso && isLiteral(?new_o) && !REGEX(STR(?new_o), "^d3f:([a-zA-Z_][a-zA-Z0-9_]*)$"))
39
+ )
40
+
41
+ }