Skip to content

Commit

Permalink
Merge pull request #216 from NeuroML/feat/add-path-regex
Browse files Browse the repository at this point in the history
feat(schema): add simple type to restrict component reference paths
  • Loading branch information
pgleeson authored Sep 11, 2023
2 parents bdf170a + 38c99fd commit 735ddc8
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions Schemas/NeuroML2/NeuroML_v2.3.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,15 @@
<xs:pattern value="[a-zA-Z0-9_:]*"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="Nml2PopulationReferencePath">
<xs:annotation>
<xs:documentation>A path referring to another component.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="(\.\./)?([a-zA-Z_][a-zA-Z0-9_]*)((\[[0-9]+\])|(/[0-9]+)+((/[a-zA-Z_][a-zA-Z0-9_]*)?)/?)"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="NonNegativeInteger">
<xs:annotation>
<xs:documentation>An attribute useful as id of segments, connections, etc: integer &gt;=0 only!</xs:documentation>
Expand Down Expand Up @@ -3097,9 +3106,9 @@
<xs:complexContent>
<xs:extension base="BaseWithoutId">
<xs:attribute name="neuroLexId" type="NeuroLexId" use="optional"/>
<xs:attribute name="from" type="xs:string" use="required"/>
<xs:attribute name="to" type="xs:string" use="required"/>
<xs:attribute name="synapse" type="xs:string" use="required"/>
<xs:attribute name="from" type="Nml2PopulationReferencePath" use="required"/>
<xs:attribute name="to" type="Nml2PopulationReferencePath" use="required"/>
<xs:attribute name="synapse" type="NmlId" use="required"/>
<xs:attribute name="destination" type="NmlId" use="optional"/>
</xs:extension>
</xs:complexContent>
Expand Down Expand Up @@ -3148,10 +3157,10 @@
</xs:annotation>
<xs:complexContent>
<xs:extension base="BaseConnection">
<xs:attribute name="preCellId" type="xs:string" use="required"/>
<xs:attribute name="preCellId" type="Nml2PopulationReferencePath" use="required"/>
<xs:attribute name="preSegmentId" type="NonNegativeInteger" default="0"/>
<xs:attribute name="preFractionAlong" type="ZeroToOne" default="0.5"/>
<xs:attribute name="postCellId" type="xs:string" use="required"/>
<xs:attribute name="postCellId" type="Nml2PopulationReferencePath" use="required"/>
<xs:attribute name="postSegmentId" type="NonNegativeInteger" default="0"/>
<xs:attribute name="postFractionAlong" type="ZeroToOne" default="0.5"/>
</xs:extension>
Expand Down Expand Up @@ -3309,9 +3318,9 @@
</xs:annotation>
<xs:complexContent>
<xs:extension base="BaseWithoutId">
<xs:attribute name="target" type="xs:string" use="required"/>
<xs:attribute name="input" type="xs:string" use="required"/>
<xs:attribute name="destination" type="xs:string"/>
<xs:attribute name="target" type="Nml2PopulationReferencePath" use="required"/>
<xs:attribute name="input" type="NmlId" use="required"/>
<xs:attribute name="destination" type="NmlId"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
Expand All @@ -3338,7 +3347,7 @@
</xs:annotation>
<xs:complexContent>
<xs:extension base="BaseNonNegativeIntegerId">
<xs:attribute name="target" type="xs:string" use="required"/>
<xs:attribute name="target" type="Nml2PopulationReferencePath" use="required"/>
<xs:attribute name="destination" type="NmlId" use="required"/>
<xs:attribute name="segmentId" type="NonNegativeInteger"/>
<xs:attribute name="fractionAlong" type="ZeroToOne"/>
Expand Down

0 comments on commit 735ddc8

Please sign in to comment.