Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table of Contents
maxLevel4

...

Overview

This page explores design issues for an efficient ORE ontology gem implementation based off the ActiveTriples framework.

Ontologies

The following is a list of all ontologies used by the Triple Examples.

Ontology NamePrefixURLDetailsComments
RDF
rdf
http://www.w3.org/1999/02/22-rdf-syntax-ns#
specification 
RDF Schemardfs
http://www.w3.org/2000/01/rdf-schema#
specification 
Dublin Coredc
http://purl.org/dc/elements/1.1/
specification 
OREore
http://www.openarchives.org/ore/terms/
specificationRepresents both ordered and unordered items using the Aggregation class.
IANAiana
http://www.iana.org/assignments/relation/
specificationORE uses this ontology for first, last, next, and prev predicates.
Friend of a Friendfoaf
http://xmlns.com/foaf/0.1
specificationUses ld4l-foaf_rdf gem.

 

ORE Triples Examples

Code Block
languagenone
titleTurtle using ORE ontology's Aggregation class
@prefix ore:     <http://www.openarchives.org/ore/terms/> .
@prefix iana:    <http://www.iana.org/assignments/relation/> .
@prefix dc:      <http://purl.org/dc/elements/1.1/> .

<http://localhost:3000/individual/vc155> a ore:Aggregation ;
  ore:aggregates <http://da-rdf.library.cornell.edu/individual/b3652730> ;
  ore:aggregates <http://da-rdf.library.cornell.edu/individual/b3652234> ;
  ore:aggregates <http://da-rdf.library.cornell.edu/individual/b3652543> ;
  iana:first <http://localhost:3000/individual/vci162> ;
  iana:last <http://localhost:3000/individual/vci164> ;
  dc:title "My list" ;
  dc:description "This is my list of references." .
 
<http://localhost:3000/individual/vci162> a ore:Proxy ;
  ore:proxyFor <http://da-rdf.library.cornell.edu/individual/b3652730> ;
  ore:proxyIn <http://localhost:3000/individual/vc155> ;
  iana:next <http://localhost:3000/individual/vci163> .
 
<http://localhost:3000/individual/vci163> a ore:Proxy ;
  ore:proxyFor <http://da-rdf.library.cornell.edu/individual/b3652234> ;
  ore:proxyIn <http://localhost:3000/individual/vc155> ;
  iana:prev <http://localhost:3000/individual/vci162> ;
  iana:next <http://localhost:3000/individual/vci164> .

 <http://localhost:3000/individual/vci164> a ore:Proxy ;
  ore:proxyFor <http://da-rdf.library.cornell.edu/individual/b3652543> ;
  ore:proxyIn <http://localhost:3000/individual/vc155> ;
  iana:prev <http://localhost:3000/individual/vci163> . 

 

...

Data Structure Approaches

...

In-memory Data StructureProsConsComments
doubly linked list+ least amount of processing during fetch (probably not significant relative to overall processing required)- iteration requires traversing next links 
convert to array on fetch

+ allows for fast access by position to loaded items
+ faster iteration than traversing next links (may not be significant)

  
convert to hash on fetch+ allows for fast fast access by proxy URI to loaded items- iteration requires traversing next links

I anticipate the need to have direct access by proxy URI more than positional.

 

Limit

...

testing for array in-memory data structure

Tests Test descriptions:

  • array_create - use Array fill method to add array items with values from 0 to max_items
  • array_move - use Array insert(to, delete_at(from)) to move an item from the end of the filled array to the beginning (worst case scenario)
  • list_create - create a list header data structure and list item data structures with sample real world data using items[i]=item_info to add each item to the items array
  • list_move - use Array insert(to,delete_at(from)) to move an item from the end of the filled array to the beginning AND update prev and next links
  • list_find - use 0.upto(items.size-1) to check the value of items[i][:uri] to see if it matches the search value for uri - Test looks search for last item in list

...

      
Max Itemsarray_createarray_movelist_createlist_movelist_find_lastlist_find_randomComments
 LaptopDEV VMLaptopDEV VMLaptop
(16Gb)
DEV VM
(2Gb)
LaptopDEV VMLaptopDEV VMLaptopDEV VM 
1,000000000000000 
10,000000000000000 
100,000000000000000 
500,000000012000000 
1,000,000000045000000 
2,000,00000001113000000 
4,000,000000035OOM0OOM1OOM0OOM 
8,000,0001100115 0 2 0  
10,000,0001100167 0 2 0  
20,000,0001200OOM OOM OOM OOM  
40,000,0004400         
80,000,0006800         
100,000,00081111         

* Time measured in seconds

...