Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
MAS
SDT
Commits
2d82a80a
Commit
2d82a80a
authored
Apr 25, 2019
by
ankraft
Browse files
Added support for semanticURI attribute
parent
11793741
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
116 additions
and
0 deletions
+116
-0
SDT/schema4.0/etc/domain.rnc
SDT/schema4.0/etc/domain.rnc
+12
-0
SDT/schema4.0/src/domain.rng
SDT/schema4.0/src/domain.rng
+61
-0
SDT/schema4.0/src/domain.xsd
SDT/schema4.0/src/domain.xsd
+12
-0
SDT/schema4.0/test/semanticURI-test.xml
SDT/schema4.0/test/semanticURI-test.xml
+31
-0
No files found.
SDT/schema4.0/etc/domain.rnc
View file @
2d82a80a
...
...
@@ -12,6 +12,7 @@ Domain =
element Domain {
attribute xml:base { xsd:anyURI }?,
attribute id { xsd:Name },
attribute semanticURI { xsd:anyURI }?,
DocDef,
element Imports { Domain+ }?,
element DataTypes { DataTypeDef+ }?,
...
...
@@ -19,12 +20,14 @@ Domain =
element DeviceClasses {
element DeviceClass {
attribute id { xsd:Name },
attribute semanticURI { xsd:anyURI }?,
DocDef,
PropertiesDef?,
ModuleClasses?,
element SubDevices {
element SubDevice {
attribute id { xsd:Name },
attribute semanticURI { xsd:anyURI }?,
DocDef,
PropertiesDef?,
ModuleClasses?
...
...
@@ -39,6 +42,7 @@ PropertiesDef =
attribute name { text },
attribute optional { xsd:boolean }?,
attribute value { text }?,
attribute semanticURI { xsd:anyURI }?,
DocDef,
SimpleType
}+
...
...
@@ -47,6 +51,7 @@ DataTypeDef =
element DataType {
attribute name { text }?,
attribute unitOfMeasure { text }?,
attribute semanticURI { xsd:anyURI }?,
DocDef,
(ExtendsDef | (StructType | ArrayType | SimpleType | EnumType)),
ConstraintsDef?
...
...
@@ -76,6 +81,7 @@ EnumValueDef =
attribute name { text },
attribute value { text },
attribute type { BasicType }?,
attribute semanticURI { xsd:anyURI }?,
DocDef
}
ConstraintsDef =
...
...
@@ -84,6 +90,7 @@ ConstraintsDef =
attribute name { text },
attribute type { BasicType }?,
attribute value { text }?,
attribute semanticURI { xsd:anyURI }?,
DocDef
}+
}
...
...
@@ -107,6 +114,7 @@ ModuleClasses =
element ModuleClass {
attribute name { text },
attribute optional { xsd:boolean }?,
attribute semanticURI { xsd:anyURI }?,
DocDef,
ExtendsDef,
# TODO: singular
...
...
@@ -121,6 +129,7 @@ Actions =
element Action {
attribute name { text },
attribute optional { xsd:boolean }?,
attribute semanticURI { xsd:anyURI }?,
DocDef,
DataTypeDef?,
ArgDef?
...
...
@@ -130,6 +139,7 @@ ArgDef =
element Args {
element Arg {
attribute name { text },
attribute semanticURI { xsd:anyURI }?,
DocDef,
DataTypeDef
}+
...
...
@@ -142,6 +152,7 @@ Data =
attribute writable { xsd:boolean }?,
attribute readable { xsd:boolean }?,
attribute eventable { xsd:boolean }?,
attribute semanticURI { xsd:anyURI }?,
DocDef,
DataTypeDef
}+
...
...
@@ -151,6 +162,7 @@ Events =
element Event {
attribute name { text },
attribute optional { xsd:boolean }?,
attribute semanticURI { xsd:anyURI }?,
DocDef,
Data?
}+
...
...
SDT/schema4.0/src/domain.rng
View file @
2d82a80a
...
...
@@ -28,6 +28,11 @@
<attribute name="id">
<data type="Name"/>
</attribute>
<optional>
<attribute name="semanticURI">
<data type="anyURI"/>
</attribute>
</optional>
<ref name="DocDef"/>
<optional>
<element name="Imports">
...
...
@@ -53,6 +58,11 @@
<attribute name="id">
<data type="Name"/>
</attribute>
<optional>
<attribute name="semanticURI">
<data type="anyURI"/>
</attribute>
</optional>
<ref name="DocDef"/>
<optional>
<ref name="PropertiesDef"/>
...
...
@@ -67,6 +77,11 @@
<attribute name="id">
<data type="Name"/>
</attribute>
<optional>
<attribute name="semanticURI">
<data type="anyURI"/>
</attribute>
</optional>
<ref name="DocDef"/>
<optional>
<ref name="PropertiesDef"/>
...
...
@@ -103,6 +118,11 @@
<text/>
</attribute>
</optional>
<optional>
<attribute name="semanticURI">
<data type="anyURI"/>
</attribute>
</optional>
<ref name="DocDef"/>
<ref name="SimpleType" />
</element>
...
...
@@ -123,6 +143,11 @@
<text/>
</attribute>
</optional>
<optional>
<attribute name="semanticURI">
<data type="anyURI"/>
</attribute>
</optional>
<ref name="DocDef"/>
<choice>
<ref name="ExtendsDef" />
...
...
@@ -205,10 +230,16 @@
<ref name="BasicType"/>
</attribute>
</optional>
<optional>
<attribute name="semanticURI">
<data type="anyURI"/>
</attribute>
</optional>
<ref name="DocDef"/>
</element>
</define>
<define name="ConstraintsDef">
<element name="Constraints">
<oneOrMore>
...
...
@@ -226,6 +257,11 @@
<text/>
</attribute>
</optional>
<optional>
<attribute name="semanticURI">
<data type="anyURI"/>
</attribute>
</optional>
<ref name="DocDef"/>
</element>
</oneOrMore>
...
...
@@ -288,6 +324,11 @@
<data type="boolean"/>
</attribute>
</optional>
<optional>
<attribute name="semanticURI">
<data type="anyURI"/>
</attribute>
</optional>
<ref name="DocDef"/>
<ref name="ExtendsDef" /> <!-- TODO: singular -->
<optional>
...
...
@@ -320,6 +361,11 @@
<data type="boolean"/>
</attribute>
</optional>
<optional>
<attribute name="semanticURI">
<data type="anyURI"/>
</attribute>
</optional>
<ref name="DocDef"/>
<optional>
<ref name="DataTypeDef"/>
...
...
@@ -338,6 +384,11 @@
<oneOrMore>
<element name="Arg">
<attribute name="name"/>
<optional>
<attribute name="semanticURI">
<data type="anyURI"/>
</attribute>
</optional>
<ref name="DocDef"/>
<ref name="DataTypeDef"/>
</element>
...
...
@@ -373,6 +424,11 @@
<data type="boolean"/>
</attribute>
</optional>
<optional>
<attribute name="semanticURI">
<data type="anyURI"/>
</attribute>
</optional>
<ref name="DocDef"/>
<ref name="DataTypeDef"/>
</element>
...
...
@@ -393,6 +449,11 @@
<data type="boolean"/>
</attribute>
</optional>
<optional>
<attribute name="semanticURI">
<data type="anyURI"/>
</attribute>
</optional>
<ref name="DocDef"/>
<optional>
<ref name="Data" />
...
...
SDT/schema4.0/src/domain.xsd
View file @
2d82a80a
...
...
@@ -27,6 +27,7 @@
</xs:sequence>
<xs:attribute
ref=
"xml:base"
/>
<xs:attribute
name=
"id"
use=
"required"
type=
"xs:Name"
/>
<xs:attribute
name=
"semanticURI"
type=
"xs:anyURI"
/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
...
...
@@ -62,6 +63,7 @@
<xs:element
minOccurs=
"0"
ref=
"SubDevices"
/>
</xs:sequence>
<xs:attribute
name=
"id"
use=
"required"
type=
"xs:Name"
/>
<xs:attribute
name=
"semanticURI"
type=
"xs:anyURI"
/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
...
...
@@ -82,6 +84,7 @@
<xs:element
minOccurs=
"0"
ref=
"ModuleClasses"
/>
</xs:sequence>
<xs:attribute
name=
"id"
use=
"required"
type=
"xs:Name"
/>
<xs:attribute
name=
"semanticURI"
type=
"xs:anyURI"
/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
...
...
@@ -103,6 +106,7 @@
<xs:attribute
name=
"name"
use=
"required"
/>
<xs:attribute
name=
"optional"
type=
"xs:boolean"
/>
<xs:attribute
name=
"value"
/>
<xs:attribute
name=
"semanticURI"
type=
"xs:anyURI"
/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
...
...
@@ -125,6 +129,7 @@
</xs:sequence>
<xs:attribute
name=
"name"
/>
<xs:attribute
name=
"unitOfMeasure"
/>
<xs:attribute
name=
"semanticURI"
type=
"xs:anyURI"
/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
...
...
@@ -178,6 +183,7 @@
<xs:attribute
name=
"name"
use=
"required"
/>
<xs:attribute
name=
"value"
use=
"required"
/>
<xs:attribute
name=
"type"
type=
"BasicType"
/>
<xs:attribute
name=
"semanticURI"
type=
"xs:anyURI"
/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
...
...
@@ -196,6 +202,7 @@
<xs:attribute
name=
"name"
use=
"required"
/>
<xs:attribute
name=
"type"
type=
"BasicType"
/>
<xs:attribute
name=
"value"
/>
<xs:attribute
name=
"semanticURI"
type=
"xs:anyURI"
/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
...
...
@@ -263,6 +270,7 @@
</xs:sequence>
<xs:attribute
name=
"name"
use=
"required"
/>
<xs:attribute
name=
"optional"
type=
"xs:boolean"
/>
<xs:attribute
name=
"semanticURI"
type=
"xs:anyURI"
/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
...
...
@@ -284,6 +292,7 @@
</xs:sequence>
<xs:attribute
name=
"name"
use=
"required"
/>
<xs:attribute
name=
"optional"
type=
"xs:boolean"
/>
<xs:attribute
name=
"semanticURI"
type=
"xs:anyURI"
/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
...
...
@@ -303,6 +312,7 @@
<xs:element
ref=
"DataType"
/>
</xs:sequence>
<xs:attribute
name=
"name"
use=
"required"
/>
<xs:attribute
name=
"semanticURI"
type=
"xs:anyURI"
/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
...
...
@@ -326,6 +336,7 @@
<xs:attribute
name=
"writable"
type=
"xs:boolean"
/>
<xs:attribute
name=
"readable"
type=
"xs:boolean"
/>
<xs:attribute
name=
"eventable"
type=
"xs:boolean"
/>
<xs:attribute
name=
"semanticURI"
type=
"xs:anyURI"
/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
...
...
@@ -346,6 +357,7 @@
</xs:sequence>
<xs:attribute
name=
"name"
use=
"required"
/>
<xs:attribute
name=
"optional"
type=
"xs:boolean"
/>
<xs:attribute
name=
"semanticURI"
type=
"xs:anyURI"
/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
...
...
SDT/schema4.0/test/semanticURI-test.xml
0 → 100644
View file @
2d82a80a
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Test the data types references -->
<Domain
id=
"semanticURI-test"
xmlns=
"http://homegatewayinitiative.org/xml/dal/4.0"
xmlns:xi=
"http://www.w3.org/2001/XInclude"
semanticURI=
"http://example.com/semanticURI-test.rdf"
>
<DataTypes>
<DataType
name=
"temperatureType"
unitOfMeasure=
"C"
semanticURI=
"http://example.com/temperatureType.rdf"
>
<SimpleType
type=
"float"
/>
</DataType>
<DataType
name=
"anEnumType"
semanticURI=
"http://example.com/anEnumType.rdf"
>
<EnumType>
<EnumValue
name=
"red"
type=
"integer"
value=
"1"
semanticURI=
"http://example.com/anEnumType-red.rdf"
/>
<EnumValue
name=
"green"
value=
"2"
semanticURI=
"http://example.com/anEnumType-green.rdf"
/>
<EnumValue
name=
"blue"
value=
"3"
semanticURI=
"http://example.com/anEnumType-blue.rdf"
/>
</EnumType>
</DataType>
</DataTypes>
<ModuleClasses>
<ModuleClass
name=
"TestDataTypes"
semanticURI=
"http://example.com/TestDataTypes.rdf"
>
<Data>
<DataPoint
name=
"TestDataPoint"
writable=
"true"
semanticURI=
"http://example.com/TestDataPoint.rdf"
>
<DataType>
<extends
domain=
"datatypes-test"
class=
"temperatureType"
/>
</DataType>
</DataPoint>
</Data>
</ModuleClass>
</ModuleClasses>
</Domain>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment