/
obfuscation.ttl
85 lines (74 loc) · 2.69 KB
/
obfuscation.ttl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# This is an example configuration file that can be used for
# the obfuscation commands. This configuration file is an
# extended version of the default which does not obfuscate
# rules, Stardog filter functions, and magic properties.
# Default namespace will be used as the base URI of the output
@prefix : <tag:stardog:api:obf:> .
# Namespaces that will be used in pattern specification
# These namespaces will also be used in the output RDF
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix stardog: <tag:stardog:api:> .
@prefix swrl: <http://www.w3.org/2003/11/swrl#> .
@prefix swrlb: <http://www.w3.org/2003/11/swrlb#> .
@prefix xpath: <http://www.w3.org/2005/xpath-functions#> .
@prefix math: <http://www.w3.org/2005/xpath-functions/math#> .
# Obfuscation namespace is used only for parsing the config file
@prefix obf: <tag:stardog:api:obf:> .
[] a obf:Obfuscation ;
# Message digest algorithm that will be used to obfuscate terms
# Should be a message digest algorithm supported by Java
obf:digest "SHA-256" ;
# Any URI and literal value will be pattern matched with the filters.
# Only the values that match the include pattern and do not match the
# exclude pattern will be obfuscated.
# The patterns in a filter expression has a position identifier which
# is one of [any, subject, predicate, object]. The pattern will be
# applied to a value depending on the position of the value.
# For example, it is possible to write filter expressions
# such that the same URI will be obfuscated when it is used in the
# subject position but not in the object position. The pattern
# expression should be a valid Java regular expression. For more
# information, see:
# http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/Pattern.html
obf:include [
obf:position obf:any ;
obf:pattern ".*"
] ;
# Filter expression may just refer to a namespace which means any URI
# belonging to that namespace will be matched. The value of the
# namespace should be defined in the namespaces declaration.
obf:exclude [
obf:position obf:any ;
obf:namespace "rdf"
] ;
obf:exclude [
obf:position obf:any ;
obf:namespace "owl"
] ;
obf:exclude [
obf:position obf:predicate ;
obf:namespace "rdfs"
] ;
obf:exclude [
obf:position obf:any ;
obf:namespace "stardog"
] ;;
obf:exclude [
obf:position obf:any ;
obf:namespace "swrl"
] ;
obf:exclude [
obf:position obf:any ;
obf:namespace "swrlb"
] ;
obf:exclude [
obf:position obf:any ;
obf:namespace "xpath"
] ;
obf:exclude [
obf:position obf:any ;
obf:namespace "math"
] .