line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package RDF::NS::Curated; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
1240
|
use 5.006000; |
|
2
|
|
|
|
|
5
|
|
4
|
2
|
|
|
2
|
|
8
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
50
|
|
5
|
2
|
|
|
2
|
|
8
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
1105
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:KJETILK'; |
8
|
|
|
|
|
|
|
our $VERSION = '1.002'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
11
|
1
|
|
|
1
|
1
|
487
|
my $class = shift; |
12
|
1
|
|
|
|
|
31
|
my %prefix_ns = ( |
13
|
|
|
|
|
|
|
acl => 'http://www.w3.org/ns/auth/acl#', |
14
|
|
|
|
|
|
|
adms => 'http://www.w3.org/ns/adms#', |
15
|
|
|
|
|
|
|
as => 'https://www.w3.org/ns/activitystreams#', |
16
|
|
|
|
|
|
|
bibo => 'http://purl.org/ontology/bibo/', |
17
|
|
|
|
|
|
|
cc => 'http://creativecommons.org/ns#', |
18
|
|
|
|
|
|
|
csvw => 'http://www.w3.org/ns/csvw#', |
19
|
|
|
|
|
|
|
ctag => 'http://commontag.org/ns#', |
20
|
|
|
|
|
|
|
dbo => 'http://dbpedia.org/ontology/', |
21
|
|
|
|
|
|
|
dbp => 'http://dbpedia.org/property/', |
22
|
|
|
|
|
|
|
dc => 'http://purl.org/dc/terms/', |
23
|
|
|
|
|
|
|
dc11 => 'http://purl.org/dc/elements/1.1/', |
24
|
|
|
|
|
|
|
dcat => 'http://www.w3.org/ns/dcat#', |
25
|
|
|
|
|
|
|
dctype => 'http://purl.org/dc/dcmitype/', |
26
|
|
|
|
|
|
|
deps => 'http://ontologi.es/doap-deps#', |
27
|
|
|
|
|
|
|
doap => 'http://usefulinc.com/ns/doap#', |
28
|
|
|
|
|
|
|
dqv => 'http://www.w3.org/ns/dqv#', |
29
|
|
|
|
|
|
|
duv => 'http://www.w3.org/ns/duv#', |
30
|
|
|
|
|
|
|
earl => 'http://www.w3.org/ns/earl#', |
31
|
|
|
|
|
|
|
event => 'http://purl.org/NET/c4dm/event.owl#', |
32
|
|
|
|
|
|
|
foaf => 'http://xmlns.com/foaf/0.1/', |
33
|
|
|
|
|
|
|
frbr => 'http://purl.org/vocab/frbr/core#', |
34
|
|
|
|
|
|
|
gn => 'http://www.geonames.org/ontology#', |
35
|
|
|
|
|
|
|
gr => 'http://purl.org/goodrelations/v1#', |
36
|
|
|
|
|
|
|
grddl => 'http://www.w3.org/2003/g/data-view#', |
37
|
|
|
|
|
|
|
hydra => 'http://www.w3.org/ns/hydra/core#', |
38
|
|
|
|
|
|
|
ical => 'http://www.w3.org/2002/12/cal/icaltzd#', |
39
|
|
|
|
|
|
|
ldp => 'http://www.w3.org/ns/ldp#', |
40
|
|
|
|
|
|
|
ma => 'http://www.w3.org/ns/ma-ont#', |
41
|
|
|
|
|
|
|
oa => 'http://www.w3.org/ns/oa#', |
42
|
|
|
|
|
|
|
odrl => 'http://www.w3.org/ns/odrl/2/', |
43
|
|
|
|
|
|
|
og => 'http://ogp.me/ns#', |
44
|
|
|
|
|
|
|
org => 'http://www.w3.org/ns/org#', |
45
|
|
|
|
|
|
|
owl => 'http://www.w3.org/2002/07/owl#', |
46
|
|
|
|
|
|
|
pos => 'http://www.w3.org/2003/01/geo/wgs84_pos#', |
47
|
|
|
|
|
|
|
prov => 'http://www.w3.org/ns/prov#', |
48
|
|
|
|
|
|
|
qb => 'http://purl.org/linked-data/cube#', |
49
|
|
|
|
|
|
|
rel => 'http://purl.org/vocab/relationship/', |
50
|
|
|
|
|
|
|
rev => 'http://purl.org/stuff/rev#', |
51
|
|
|
|
|
|
|
rif => 'http://www.w3.org/2007/rif#', |
52
|
|
|
|
|
|
|
rdf => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#', |
53
|
|
|
|
|
|
|
rdfa => 'http://www.w3.org/ns/rdfa#', |
54
|
|
|
|
|
|
|
rdfs => 'http://www.w3.org/2000/01/rdf-schema#', |
55
|
|
|
|
|
|
|
rr => 'http://www.w3.org/ns/r2rml#', |
56
|
|
|
|
|
|
|
schema => 'http://schema.org/', |
57
|
|
|
|
|
|
|
sd => 'http://www.w3.org/ns/sparql-service-description#', |
58
|
|
|
|
|
|
|
sioc => 'http://rdfs.org/sioc/ns#', |
59
|
|
|
|
|
|
|
skos => 'http://www.w3.org/2004/02/skos/core#', |
60
|
|
|
|
|
|
|
skosxl => 'http://www.w3.org/2008/05/skos-xl#', |
61
|
|
|
|
|
|
|
solid => 'http://www.w3.org/ns/solid/terms#', |
62
|
|
|
|
|
|
|
sosa => 'http://www.w3.org/ns/sosa/', |
63
|
|
|
|
|
|
|
ssn => 'http://www.w3.org/ns/ssn/', |
64
|
|
|
|
|
|
|
time => 'http://www.w3.org/2006/time#', |
65
|
|
|
|
|
|
|
v => 'http://rdf.data-vocabulary.org/#', |
66
|
|
|
|
|
|
|
vann => 'http://purl.org/vocab/vann/', |
67
|
|
|
|
|
|
|
vcard => 'http://www.w3.org/2006/vcard/ns#', |
68
|
|
|
|
|
|
|
void => 'http://rdfs.org/ns/void#', |
69
|
|
|
|
|
|
|
vs => 'http://www.w3.org/2003/06/sw-vocab-status/ns#', |
70
|
|
|
|
|
|
|
wdr => 'http://www.w3.org/2007/05/powder#', |
71
|
|
|
|
|
|
|
wdrs => 'http://www.w3.org/2007/05/powder-s#', |
72
|
|
|
|
|
|
|
xhv => 'http://www.w3.org/1999/xhtml/vocab#', |
73
|
|
|
|
|
|
|
xml => 'http://www.w3.org/XML/1998/namespace', |
74
|
|
|
|
|
|
|
xsd => 'http://www.w3.org/2001/XMLSchema#', |
75
|
|
|
|
|
|
|
yago => 'http://yago-knowledge.org/resource/', |
76
|
|
|
|
|
|
|
); |
77
|
|
|
|
|
|
|
|
78
|
1
|
|
|
|
|
3
|
my $self = { |
79
|
|
|
|
|
|
|
prefix_namespace => \%prefix_ns |
80
|
|
|
|
|
|
|
}; |
81
|
1
|
|
|
|
|
3
|
return bless($self, $class); |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
sub uri { |
85
|
2
|
|
|
2
|
1
|
315
|
my $self = shift; |
86
|
2
|
|
|
|
|
4
|
my $prefix = shift; |
87
|
2
|
|
|
|
|
12
|
return $self->{prefix_namespace}->{$prefix}; |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
sub prefix { |
91
|
3
|
|
|
3
|
1
|
6
|
my $self = shift; |
92
|
3
|
|
|
|
|
3
|
my $namespace = shift; |
93
|
3
|
|
|
|
|
4
|
my $ns_prefix = $self->{namespace_prefix}; |
94
|
3
|
100
|
|
|
|
7
|
unless ($ns_prefix) { |
95
|
1
|
|
|
|
|
2
|
$ns_prefix = {reverse %{$self->{prefix_namespace}}}; |
|
1
|
|
|
|
|
42
|
|
96
|
1
|
|
|
|
|
4
|
$self->{namespace_prefix} = $ns_prefix; |
97
|
|
|
|
|
|
|
} |
98
|
3
|
|
|
|
|
13
|
return $ns_prefix->{$namespace}; |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
sub qname { |
102
|
5
|
|
|
5
|
1
|
506
|
my $self = shift; |
103
|
5
|
|
|
|
|
6
|
my $uri = shift; |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
# regexpes copied from RDF::Trine::Node::Resource |
106
|
5
|
|
66
|
|
|
18
|
our $r_PN_CHARS_BASE ||= qr/([A-Z]|[a-z]|[\x{00C0}-\x{00D6}]|[\x{00D8}-\x{00F6}]|[\x{00F8}-\x{02FF}]|[\x{0370}-\x{037D}]|[\x{037F}-\x{1FFF}]|[\x{200C}-\x{200D}]|[\x{2070}-\x{218F}]|[\x{2C00}-\x{2FEF}]|[\x{3001}-\x{D7FF}]|[\x{F900}-\x{FDCF}]|[\x{FDF0}-\x{FFFD}]|[\x{10000}-\x{EFFFF}])/; |
107
|
5
|
|
66
|
|
|
75
|
our $r_PN_CHARS_U ||= qr/(_|${r_PN_CHARS_BASE})/; |
108
|
5
|
|
66
|
|
|
82
|
our $r_PN_CHARS ||= qr/${r_PN_CHARS_U}|-|[0-9]|\x{00B7}|[\x{0300}-\x{036F}]|[\x{203F}-\x{2040}]/; |
109
|
5
|
|
66
|
|
|
180
|
our $r_PN_LOCAL ||= qr/((${r_PN_CHARS_U})((${r_PN_CHARS}|[.])*${r_PN_CHARS})?)/; |
110
|
|
|
|
|
|
|
|
111
|
5
|
|
|
|
|
12
|
my $ln; |
112
|
|
|
|
|
|
|
my $pr; |
113
|
5
|
|
|
|
|
6
|
while (my ($prefix, $namespace) = each(%{$self->{prefix_namespace}})) { |
|
199
|
|
|
|
|
626
|
|
114
|
197
|
100
|
|
|
|
18400
|
if($uri =~ m/^$namespace(${r_PN_LOCAL})$/) { |
115
|
3
|
|
|
|
|
10
|
$ln = $1; |
116
|
3
|
|
|
|
|
4
|
$pr = $prefix; |
117
|
3
|
|
|
|
|
4
|
my $n = scalar keys (%{$self->{prefix_namespace}}); # reset iterator |
|
3
|
|
|
|
|
7
|
|
118
|
3
|
|
|
|
|
15
|
last; |
119
|
|
|
|
|
|
|
} |
120
|
|
|
|
|
|
|
} |
121
|
5
|
100
|
|
|
|
28
|
return unless defined($ln); |
122
|
3
|
100
|
|
|
|
21
|
return wantarray ? ($pr, $ln) : "$pr:$ln"; |
123
|
|
|
|
|
|
|
} |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
sub all { |
126
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
127
|
0
|
|
|
|
|
|
return $self->{prefix_namespace}; |
128
|
|
|
|
|
|
|
} |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
1; |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
__END__ |