使用 XML-Schema 可以扩展像 FOAF 这样的 rdf 词汇表,但是如何在定义中使用此类词汇表中的类?基本上我想向 foaf:person 添加新元素,并且我想确保拥有这些元素意味着这个对象是一个 foaf:Person 而不是别的。
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/NewXMLSchema" xmlns:foaf="http://xmlns.com/foaf/0.1/" elementFormDefault="qualified">
<xs:import foaf:namespace="http://xmlns.com/foaf/0.1/" foaf:schemaLocation="http://xmlns.com/foaf/spec/index.rdf"/>
<xs:complexType ref="foaf:Person">
<xs:sequence>
<xs:element name="owns">
<xs:complexType>
<xs:sequence>
<xs:element name="device">
<xs:complexType>
<xs:sequence>
<xs:element name="HereBeSomething"></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="datapoints">
<xs:complexType>
<xs:sequence>
<xs:element name="point" type="xs:string"></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
复杂类型应该是 foaf:Person,但是这种排列会导致错误:
“在此行找到多个注释:- s4s-att-must-appear:属性 'name' 必须出现在元素 'complexType' 中。- s4s-att-not-allowed:属性 'ref' 不能出现在元素 'complexType' 中。 "
如何在我的新模式的定义中使用来自其他 RDF 本体的类型?