xml.n3
3.24 KB
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
@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 foaf: <http://xmlns.com/foaf/0.1/>.
@prefix dc: <http://purl.org/dc/elements/1.1/>.
@prefix doc: <http://www.w3.org/2000/10/swap/pim/doc#> .
@prefix : <http://www.w3.org/2007/ont/xml#> .
@keywords is, of, a.
# See for example http://docs.python.org/lib/node218.html
<> a owl:Ontology;
dc:title "An ontology for the XML DOM";
rdfs:comment """This ontology is used for representing an XML document for
processing as an XML graph.
Where the semantics match, the names of XML DOM components are used.
""".
Node a rdfs:class;
rdfs:label "XML Node";
rdfs:comment """A node is defined by the W3C XML Document Object Model
specifications. There are many nodes in a tree""".
Document a rdfs:Class;
rdfs:subClassOf Node;
rdfs:label "XML document tree";
rdfs:comment """A node tree is defined by the W3C XMl Document Object Model
specifications.""".
Element a rdfs:Class; rdfs:subSetOf Node;
rdfs:label "element".
TextNode a rdfs:Class; rdfs:subSetOf Node;
rdfs:label "text node".
Comment a rdfs:Class; rdfs:subSetOf Node;
rdfs:label "comment".
TextNode a rdfs:Class; rdfs:subSetOf Node;
rdfs:label "text node".
ProcessingInstruction a rdfs:Class; rdfs:subSetOf Node;
rdfs:label "processing instruction".
Attribute a rdfs:Class; rdfs:subClassOf Node;
rdfs:label "attribute".
dom a rdf:Property, owl:FunctionalProperty;
rdfs:label "XML node tree";
rdfs:comment """A doc:Work can be parsed to a xml:Document
and then the FunctionalProperties in this ontology can be used
(e.g. in CWM) to explore the XML node tree.
""";
rdfs:domain doc:Work;
rdfs:range DOM.
ns a rdf:Property, owl:FunctionalProperty;
rdfs:label "namespace";
rdfs:comment """The URI corresponding to the tag name prefix used if any,
or the default namespace if no prefix was used and a default namespace
is declared.""";
rdfs:domain Node. # Range URI string
localName a rdf:Property, owl:FunctionalProperty;
rdfs:label "local name";
rdfs:comment """The part without any prefix or colon.""";
rdfs:domain Node. # Range URI string
tagName a rdf:Property, owl:FunctionalProperty;
rdfs:label "tag name";
rdfs:comment """The tag name includes any prefix and colon as well as the local name.""";
rdfs:domain Node. # Range URI string
parent a rdfs:Property, owl:FunctionalProperty;
rdfs:label "parent";
rdfs:domain Node;
rdfs:range Node.
children a rdfs:Property, owl:FunctionalProperty;
rdfs:label "children";
rdfs:comment """The list of child nodes is ordered and may be empty""";
rdfs:domain Node;
rdfs:range NodeList. # List of Nodes, an RDF collection
NodeList a rdfs:Class; rdfs:subClassOf rdf:List.
firstChild a rdfs:Property, owl:FunctionalProperty;
rdfs:label "first child";
rdfs:domain Node;
rdfs:range Node.
######## Attributes
attribute a rdfs:Property, owl:FunctionalProperty;
rdfs:label "attribute";
rdfs:domain Element;
rdfs:range Attribute.
value a rdfs:Property;
rdfs:label "value".