Difference between revisions of "New ideas for coding with Arrays, Lists and Sequences in RDF"

From lotico
Jump to navigation Jump to search
 
(6 intermediate revisions by the same user not shown)
Line 21: Line 21:
 
  arlise:Station1
 
  arlise:Station1
 
   rdf:type arlise:SoR ;
 
   rdf:type arlise:SoR ;
   arlise:hasList "{1 5 10 15 22 24 25 18 17 10 5 0}" ;
+
   arlise:hasList "{1,5,10,15,22,24,25,18,17,10,5,0}" ;
 
  .
 
  .
  
 +
Numbers Array embbeded:
 +
 +
arlise:Station1
 +
  rdf:type arlise:SoRE ;
 +
  arlise:hasArrayE
 +
      [1:1,2:5,3:10,4:15,5:22,6:24,7:25,8:18,9:17,10:10,11:5,12:0] ;
 +
.
 +
 +
 +
Numbers List Embedded:
 +
 +
arlise:Station1
 +
  rdf:type arlise:SoRE ;
 +
  arlise:hasListE [1,5,10,15,22,24,25,18,17,10,5,0] ;
 +
.
 +
 +
 +
Associative arrays:
 +
 +
arlise:Station1
 +
  rdf:type arlise:SoR ;
 +
  arlise:ArLeSeq_Multi "{'Mike':4,'Peter':5,'Gregg':8,'Tim':6}" ;
 +
.
 +
 +
arlise:Station1
 +
  rdf:type arlise:SoR ;
 +
  arlise:ArLeSeq_Multi "{1999:'Mike',2001:'Peter',2009:'Gregg',2020:'Tim'}" ;
 +
.
 +
 +
arlise:Station1
 +
  rdf:type arlise:SoR ;
 +
  arlise:ArLeSeq_Multi "{1999:['Mike','Peter'],2001:['Andy','Hans','Tom'],2009:'Gregg',2020:['Armin','John','Rolf']}" ;
 +
.
  
 
Strings Sorted:
 
Strings Sorted:
  
:resource1 lotico:ArLiSeq_SS {1:'Mike';2:'Peter';3:'Tim;4:'Marco';....}
+
:resource1 lotico:ArLiSeq_SS {1:'Mike',2:'Peter',3:'Tim;4:'Marco',....}
  
 
Strings unsorted:
 
Strings unsorted:
  
:resource1 lotico:ArLiSeq_SU "{'Mike';'Peter';'Tim;'Marco;....}"
+
:resource1 lotico:ArLiSeq_SU "{'Mike','Peter','Tim','Marco',....}"
  
  
Line 37: Line 70:
  
 
:resource1 lotico:ArLiSeq_JSON "%7B%20%22name%22%3A%22Marco%22%2C%20%22age%22%3A30%2C%20%22car%22%3Anull%20%7D";
 
:resource1 lotico:ArLiSeq_JSON "%7B%20%22name%22%3A%22Marco%22%2C%20%22age%22%3A30%2C%20%22car%22%3Anull%20%7D";
 +
 +
JSON-LD object
 +
 +
:resource1 lotico:ArLiSeq_JSON-LD "%7B%0A%20%20%22%40context%22%3A%20%22https%3A%2F%2Fjson-ld.org%2Fcontexts%2Fperson.jsonld%22%2C%0A%20%20%22%40id%22%3A%20%22http%3A%2F%2Fdbpedia.org%2Fresource%2FJohn_Lennon%22%2C%0A%20%20%22name%22%3A%20%22John%20Lennon%22%2C%0A%20%20%22born%22%3A%20%221940-10-09%22%2C%0A%20%20%22spouse%22%3A%20%22http%3A%2F%2Fdbpedia.org%2Fresource%2FCynthia_Lennon%22%0A%7D";
  
  

Latest revision as of 14:38, 17 March 2020

New ideas to deal with large series of data points in RDF in the form of arrays, lists and similar data structures.

currently RDF data model proposed rdf:Bag and rdf:Seq in the form of

resource1 a rdf:Bag;
 rdf:_1 "1323";
 rdf:_2 "1321";
.

we propose here the following additional notation for large sequences:

Numbers Array:

arlise:Station1
 rdf:type arlise:SoR ;
 arlise:hasArray "{1:1,2:5,3:10,4:15,5:22,6:24,7:25,8:18,9:17,10:10,11:5,12:0}" ;
.

Numbers List:

arlise:Station1
 rdf:type arlise:SoR ;
 arlise:hasList "{1,5,10,15,22,24,25,18,17,10,5,0}" ;
.

Numbers Array embbeded:

arlise:Station1
 rdf:type arlise:SoRE ;
 arlise:hasArrayE 
      [1:1,2:5,3:10,4:15,5:22,6:24,7:25,8:18,9:17,10:10,11:5,12:0] ;
.


Numbers List Embedded:

arlise:Station1
 rdf:type arlise:SoRE ;
 arlise:hasListE [1,5,10,15,22,24,25,18,17,10,5,0] ;
.


Associative arrays:

arlise:Station1
 rdf:type arlise:SoR ;
 arlise:ArLeSeq_Multi "{'Mike':4,'Peter':5,'Gregg':8,'Tim':6}" ;
.
arlise:Station1
 rdf:type arlise:SoR ;
 arlise:ArLeSeq_Multi "{1999:'Mike',2001:'Peter',2009:'Gregg',2020:'Tim'}" ;
.

arlise:Station1

 rdf:type arlise:SoR ;
 arlise:ArLeSeq_Multi "{1999:['Mike','Peter'],2001:['Andy','Hans','Tom'],2009:'Gregg',2020:['Armin','John','Rolf']}" ;
.

Strings Sorted:

resource1 lotico:ArLiSeq_SS {1:'Mike',2:'Peter',3:'Tim;4:'Marco',....}

Strings unsorted:

resource1 lotico:ArLiSeq_SU "{'Mike','Peter','Tim','Marco',....}"


JSON object

resource1 lotico:ArLiSeq_JSON "%7B%20%22name%22%3A%22Marco%22%2C%20%22age%22%3A30%2C%20%22car%22%3Anull%20%7D";

JSON-LD object

resource1 lotico:ArLiSeq_JSON-LD "%7B%0A%20%20%22%40context%22%3A%20%22https%3A%2F%2Fjson-ld.org%2Fcontexts%2Fperson.jsonld%22%2C%0A%20%20%22%40id%22%3A%20%22http%3A%2F%2Fdbpedia.org%2Fresource%2FJohn_Lennon%22%2C%0A%20%20%22name%22%3A%20%22John%20Lennon%22%2C%0A%20%20%22born%22%3A%20%221940-10-09%22%2C%0A%20%20%22spouse%22%3A%20%22http%3A%2F%2Fdbpedia.org%2Fresource%2FCynthia_Lennon%22%0A%7D";


Access Method Examples

SELECT avg(?array)
WHERE{
 ?resource arlise:hasArray ?array
}
SELECT ?array[1]
WHERE{
 ?resource arlise:hasArray ?array
}