Skip to content

Commit

Permalink
Extends alsfrs.xml with typeparameters
Browse files Browse the repository at this point in the history
  • Loading branch information
k00ni committed Nov 13, 2011
1 parent 682c69a commit 741ff05
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 5 deletions.
17 changes: 14 additions & 3 deletions classes/Formula.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ public function __construct($index, $selectedModel)
{
$this->_data = array ();

$this->setIndex ($index);
$this->setIndex ($index);
$this->_data ['targetclass'] = '';
$this->_data ['labelparts'] = array ();
$this->_data ['title'] = '';
$this->_data ['description'] = '';
$this->_data ['mode'] = 'new';
Expand Down Expand Up @@ -594,15 +596,15 @@ public function getPredicateValue ($index)
return '';
}


/**
* replace the architecture namespace string with the correct uri
* @param $s
* @return string
*/
public function replaceNamespaces($s)
{

$namespaceUri = "";
$namespaceUri = '';

// fetch properties of a resource
$result = $this->_selectedModel->sparqlQuery(
Expand All @@ -617,4 +619,13 @@ public function replaceNamespaces($s)

return str_replace('architecture:', $namespaceUri, $s);
}


/**
*
*/
public function generateAlsfrsPredicates ()
{

}
}
58 changes: 56 additions & 2 deletions classes/XmlConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,61 @@ public function loadFile ($file, &$form)

// set typeparameters
switch ( $type )
{
{
// ALSFRS: complex structure of relations and instances
case 'alsfrs':

$typeparameter ['predicateToHealthState'] = (string)
$predicate->typeparameter->predicateToHealthState;

$typeparameter ['healthState'] = $predicate->typeparameter->healthState;

$typeparameter ['predicateToPropertySet'] = (string)
$predicate->typeparameter->predicateToPropertySet;

$typeparameter ['propertySet'] = $predicate->typeparameter->propertySet;

$typeparameter ['predicateToSymptomSet'] = (string)
$predicate->typeparameter->predicateToSymptomSet;

$typeparameter ['symptomSet'] = $predicate->typeparameter->symptomSet;

$typeparameter ['predicateToPropertyOption'] = (string)
$predicate->typeparameter->predicateToPropertyOption;

$typeparameter ['predicateToSymptomOption'] = (string)
$predicate->typeparameter->predicateToSymptomOption;

// topic
$typeparameter ['topic'] = (string)
$predicate->typeparameter->topic;

$typeparameter ['topicLabel'] = (string)
$predicate->typeparameter->topicLabel;

$typeparameter ['topicSuggestedQuestion'] = (string)
$predicate->typeparameter->topicSuggestedQuestion;

$typeparameter ['topicHasOption'] = (string)
$predicate->typeparameter->topicHasOption;

// option
$typeparameter ['option'] = (string)
$predicate->typeparameter->option;

$typeparameter ['optionLabel'] = (string)
$predicate->typeparameter->optionLabel;

// clear assignment which topics are SymptomOptions
foreach ($predicate->typeparameter->pertainsToSymptomSet->item as $parameter)
$typeparameter ['pertainsToSymptomSet'][] = (string) $parameter;

// clear assignment which topics are PropertyOptions
foreach ($predicate->typeparameter->pertainsToPropertySet->item as $parameter)
$typeparameter ['pertainsToPropertySet'][] = (string) $parameter;

break;

case 'date':
break;

Expand All @@ -132,7 +186,7 @@ public function loadFile ($file, &$form)
}
break;

default: // xsd:string
default:
break;
}

Expand Down
53 changes: 53 additions & 0 deletions xmlconfigurationfiles/alsfrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,59 @@
<!-- Textfield -->
<predicate>
<type>alsfrs</type>
<typeparameter>

<!-- Patientresource has healthStateInstance -->
<predicateToHealthState>has</predicateToHealthState>
<healthState>http://als.dispedia.info/wrapperAlsfrs/c/20111105/ALSFRSHealthState</healthState>

<!-- healthStateInstance includesAffectedProperties ALSFRSPropertySet -->
<predicateToPropertySet>http://als.dispedia.info/architecture/c/20110827/includesAffectedProperties</predicateToPropertySet>
<propertySet>http://als.dispedia.info/wrapperAlsfrs/c/20111105/ALSFRSPropertySet</propertySet>

<!-- healthStateInstance includesSymptoms ALSFRSSymptomSet-Instance -->
<predicateToSymptomSet>http://als.dispedia.info/architecture/c/20110827/includesSymptoms</predicateToSymptomSet>
<symptomSet>http://als.dispedia.info/wrapperAlsfrs/c/20111105/ALSFRSSymptomSet</symptomSet>

<!-- ALSFRSPropertySet-Instance containsPropertyOption Option-Instance -->
<predicateToPropertyOption>http://als.dispedia.info/wrapperAlsfrs/c/20111105/containsPropertyOption</predicateToPropertyOption>

<!-- ALSFRSSymptomSet-Instance containsSymptomOption Option-Instance -->
<predicateToSymptomOption>http://als.dispedia.info/wrapperAlsfrs/c/20111105/containsSymptomOption</predicateToSymptomOption>

<!-- Topic related stuff -->
<topic>http://als.dispedia.info/frs/o/Topic</topic>
<topicLabel>http://www.w3.org/2000/01/rdf-schema#label</topicLabel>
<topicSuggestedQuestion>http://als.dispedia.info/frs/o/suggestedQuestion</topicSuggestedQuestion>
<topicHasOption>http://als.dispedia.info/frs/o/hasOption</topicHasOption>

<!-- Option related stuff -->
<option>http://als.dispedia.info/frs/o/Option</option>
<optionLabel>http://www.w3.org/2000/01/rdf-schema#label</optionLabel>
<optionHasScore>http://als.dispedia.info/frs/o/hasScore</optionHasScore>

<!-- clear assignment which topics are SymptomOptions -->
<pertainsToSymptomSet>
<item>http://als.dispedia.info/frs/i/topic/t2</item>
<item>http://als.dispedia.info/frs/i/topic/t4</item>
<item>http://als.dispedia.info/frs/i/topic/t8</item>
<item>http://als.dispedia.info/frs/i/topic/t10</item>
<item>http://als.dispedia.info/frs/i/topic/t11</item>
</pertainsToSymptomSet>

<!-- clear assignment which topics are PropertyOptions -->
<pertainsToPropertySet>
<item>http://als.dispedia.info/frs/i/topic/t1</item>
<item>http://als.dispedia.info/frs/i/topic/t3</item>
<item>http://als.dispedia.info/frs/i/topic/t5a</item>
<item>http://als.dispedia.info/frs/i/topic/t5b</item>
<item>http://als.dispedia.info/frs/i/topic/t6</item>
<item>http://als.dispedia.info/frs/i/topic/t7</item>
<item>http://als.dispedia.info/frs/i/topic/t9</item>
<item>http://als.dispedia.info/frs/i/topic/t12</item>
</pertainsToPropertySet>

</typeparameter>
</predicate>

</item>
Expand Down

0 comments on commit 741ff05

Please sign in to comment.