@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix qudt: <http://qudt.org/schema/qudt/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

qudt:HeterogenousArray a rdfs:Class,
        owl:Class,
        sh:NodeShape ;
    rdfs:label "Heterogenous Array" ;
    dcterms:description """
  <p>An <em>Array></em> is a data structure that stores a collection of elements, typically of the same type, in a contiguous block of memory. 
  Each element in an array is identified by an index or key, which is typically a numerical identifier, either starting at '0' or '1'.
  </p>
  <p>The key considerations for an Array are:
  </p>
  <ol>
  <li>Fixed Size: The size of an array may be pre-determined when it is created and cannot be changed;</li>
  <li>Index-Based Access: Elements can be accessed, updated, or modified using their index;</li>
  <li>Heterogenous Elements: all elements in the array may be of different data types;</li>
  <li>Contiguous Memory Allocation: 
    the elements are stored in consecutive memory locations, which allows efficient access using the index.</li>
  </ol>
  <p>An Array is represented as ordered entries of values arranged according to its dimensionality.
  The number of dimensions is specified in the attribute 'dimensionality'.
  </p>
  <p>The property 'qudt:datatype' refers to a list if the datatypes of the elements.  
  </p>
  <p>An heterogenous array can be multi-dimensional.
  Multiple indices are used but they are treated as extensions of the same structure.
  For example: for a 2D array arr[2][3], indices refer to the row and column positions.
  A 2D array is still represented as a list, where each member of the list is a list.
  </p>
  <p>Higher dimensional arrays can be represented as nested lists.
  For each dimension a new nested list is defined.
  </p>"""^^rdf:HTML ;
    rdfs:isDefinedBy <http://qudt.org/3.2.1/schema/datatype>,
        <http://qudt.org/3.2.1/schema/shacl/datatype> ;
    rdfs:subClassOf [ a owl:Restriction ;
            owl:minCardinality 1 ;
            owl:onProperty qudt:datatype ],
        [ a owl:Restriction ;
            owl:maxCardinality 1 ;
            owl:onProperty qudt:datatype ],
        [ a owl:Restriction ;
            owl:cardinality 1 ;
            owl:onProperty qudt:datatype ],
        qudt:Array ;
    sh:property qudt:HeterogenousArray-datatype .

