Using iteration to CONSTRUCT iteration on the fly ...

I have a problem where I want to transform one representation of tabular
data to another. In the source representation, the table is represented by
the number of rows and the number of columns in the table (both properties
are integers):



:Table

      a       owl:Class ;

      rdfs:subClassOf

              [ a       owl:Restriction ;

                owl:cardinality "1"^^xsd:int ;

                owl:onProperty :hasNumberOfRows

              ] ;

      rdfs:subClassOf

              [ a       owl:Restriction ;

                owl:cardinality "1"^^xsd:int ;

                owl:onProperty :hasNumberOfColumns

              ] .



In the second representation, the table is represented as a list of cells:



:ComplexTable

      a       owl:Class ;

      rdfs:subClassOf

              [ a       owl:Restriction ;

                owl:allValuesFrom :CellType ;

                owl:onProperty :hasCell

              ] ;

      rdfs:subClassOf

              [ a       owl:Restriction ;

                owl:minCardinality  "1"^^xsd:int ;

                owl:onProperty :hasCell

              ] .



Basically what I want to do is the equivalent of iterating over the number
of rows and columns in the first representation, and create instances of the
:CellType in the second representation.



Is this possible using only SPARQL?

Received on Wednesday, 17 November 2010 09:51:57 UTC