[moriarty] r324 committed - updated sequence value code to allow for sequences with joint ranks - ...

0 views
Skip to first unread message

mori...@googlecode.com

unread,
Sep 29, 2011, 6:38:05 AM9/29/11
to moriarty...@googlegroups.com
Revision: 324
Author: mmmmmrob
Date: Thu Sep 29 03:36:55 2011
Log: updated sequence value code to allow for sequences with joint
ranks - i.e. two objects in rdf:_31
http://code.google.com/p/moriarty/source/detail?r=324

Modified:
/trunk/simplegraph.class.php

=======================================
--- /trunk/simplegraph.class.php Tue Aug 2 08:53:06 2011
+++ /trunk/simplegraph.class.php Thu Sep 29 03:36:55 2011
@@ -1357,37 +1357,30 @@

function get_sequence_values($sequenceUri) {
$triples = $this->get_index();
- $properties = array();
+ $found_values = array();

if (isset($triples[$sequenceUri]))
{
foreach ($triples[$sequenceUri] as $property => $objects)
{
- if (strpos($property, RDF_) !== false)
- {
- $key = substr($property, strpos($property, '_') + 1
);
- $value = $this->get_first_resource($sequenceUri,
$property);
-
-
- if (empty($value))
- {
- $value = $this->get_first_literal($sequenceUri,
$property);
- }
-
- $properties[$key] = $value;
- }
- }
-
- ksort($properties, SORT_NUMERIC);
- }
-
- $values = array();
-
- foreach($properties as $key=>$value)
- {
+ if (strpos($property, RDF_) !== false)
+ {
+ $key = substr($property, strpos($property, '_') + 1 );
+ foreach ($objects as $object)
+ {
+ $found_values[$key][] = $object['value'];
+ }
+ }
+ }
+ ksort($found_values, SORT_NUMERIC);
+ }
+ foreach($found_values as $key_values)
+ {
+ foreach($key_values as $value)
+ {
$values[] = $value;
- }
-
+ }
+ }
return $values;
}

Reply all
Reply to author
Forward
0 new messages