Commit 7596ae4c authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

[profile gen] Consider keyword reference entity to control presence of...

[profile gen] Consider keyword reference entity to control presence of KeywordReference tag in SEDA 1.0 / 0.2 export

Related to #16269136
parent e29d3877b59c
......@@ -1059,10 +1059,13 @@ class SEDA1XSDExport(SEDA2XSDExport):
self.element_schema(kw_node, 'KeywordContent', self.kw_content_tag_type,
fixed_value=content,
xsd_attributes=self.kw_content_tag_attributes)
scheme = keyword.reference.scheme if keyword.reference else None
self.element_schema(kw_node, 'KeywordReference', 'qdt:ArchivesIDType',
fixed_value=url,
xsd_attributes=self.xsd_attributes_scheme(scheme))
if keyword.reference:
scheme = keyword.reference.scheme
self.element_schema(kw_node, 'KeywordReference', 'qdt:ArchivesIDType',
cardinality=keyword.reference.user_cardinality,
documentation=keyword.reference.user_annotation,
fixed_value=url,
xsd_attributes=self.xsd_attributes_scheme(scheme))
# XXX keyword type
def xsd_children(self, parent, entity):
......
......@@ -78,15 +78,17 @@
<rng:element name="KeywordContent">
<rng:value type="string">file</rng:value>
</rng:element>
<rng:element name="KeywordReference">
<rng:attribute name="schemeName">
<rng:value type="string">seda_description_level/None vocabulary</rng:value>
</rng:attribute>
<rng:attribute name="schemeURI">
<rng:value type="anyURI">%(scheme-uri)s</rng:value>
</rng:attribute>
<rng:value type="string">%(concept-uri)s</rng:value>
</rng:element>
<rng:optional>
<rng:element name="KeywordReference">
<rng:attribute name="schemeName">
<rng:value type="string">seda_description_level/None vocabulary</rng:value>
</rng:attribute>
<rng:attribute name="schemeURI">
<rng:value type="anyURI">%(scheme-uri)s</rng:value>
</rng:attribute>
<rng:value type="string">%(concept-uri)s</rng:value>
</rng:element>
</rng:optional>
</rng:element>
</rng:zeroOrMore>
</rng:element>
......
......@@ -137,7 +137,7 @@
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
<xsd:element fixed="%(concept-uri)s" name="KeywordReference">
<xsd:element fixed="%(concept-uri)s" name="KeywordReference" minOccurs="0">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="qdt:ArchivesIDType">
......
......@@ -87,15 +87,17 @@
<rng:element name="KeywordContent">
<rng:value type="string">file</rng:value>
</rng:element>
<rng:element name="KeywordReference">
<rng:attribute name="schemeName">
<rng:value type="string">seda_description_level/None vocabulary</rng:value>
</rng:attribute>
<rng:attribute name="schemeURI">
<rng:value type="anyURI">%(scheme-uri)s</rng:value>
</rng:attribute>
<rng:value type="string">%(concept-uri)s</rng:value>
</rng:element>
<rng:optional>
<rng:element name="KeywordReference">
<rng:attribute name="schemeName">
<rng:value type="string">seda_description_level/None vocabulary</rng:value>
</rng:attribute>
<rng:attribute name="schemeURI">
<rng:value type="anyURI">%(scheme-uri)s</rng:value>
</rng:attribute>
<rng:value type="string">%(concept-uri)s</rng:value>
</rng:element>
</rng:optional>
</rng:element>
</rng:zeroOrMore>
</rng:element>
......
......@@ -138,7 +138,7 @@
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
<xsd:element fixed="%(concept-uri)s" name="KeywordReference">
<xsd:element fixed="%(concept-uri)s" name="KeywordReference" minOccurs="0">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="qdt:ArchivesIDType">
......
......@@ -850,6 +850,7 @@ class OldSEDARNGExportTC(RelaxNGTestMixin, OldSEDAExportMixin, CubicWebTC):
create('SEDAEndDate', seda_end_date=subcontent)
kw = create('SEDAKeyword', user_cardinality=u'0..n', seda_keyword=subcontent)
create('SEDAKeywordContent', reverse_seda_keyword_content=kw)
create('SEDAKeywordReference', seda_keyword_reference_from=kw)
bdo = create_data_object(transfer)
create('SEDADataObjectReference',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment