Index: trunk/extensions/SemanticMediaWiki/specials/ExportRDF/SMW_SpecialExportRDF.php |
— | — | @@ -1,6 +1,7 @@ |
2 | 2 | <?php |
3 | 3 | /** |
4 | 4 | * @author Markus Krötzsch |
| 5 | + * @author Denny Vrandecic |
5 | 6 | * |
6 | 7 | * This special page for MediaWiki implements an RDF-export of |
7 | 8 | * semantic data, gathered both from the annotations in articles, |
— | — | @@ -100,7 +101,7 @@ |
101 | 102 | // Values for special properties, see SMW_Settings.php for documentation. |
102 | 103 | // Each value may be missing if not set or not relevant |
103 | 104 | public $has_type = false; |
104 | | - public $has_uri = false; |
| 105 | + public $has_uri = false; // TODO not used right now |
105 | 106 | public $ext_nsid = false; |
106 | 107 | public $ext_section = false; |
107 | 108 | // relevant title values, mandatory |
— | — | @@ -112,6 +113,7 @@ |
113 | 114 | public $title_prefurl; |
114 | 115 | public $title_dbkey; |
115 | 116 | public $modifier = ''; |
| 117 | + public $value; // the title as a datavalue |
116 | 118 | // details about URIs for export |
117 | 119 | public $ns_uri = false; |
118 | 120 | public $short_uri; |
— | — | @@ -135,6 +137,7 @@ |
136 | 138 | $this->title_fragment = $title->getFragment(); |
137 | 139 | $this->title_prefurl = $title->getPrefixedURL(); |
138 | 140 | $this->title_dbkey = $title->getDBKey(); |
| 141 | + $this->value = SMWDataValueFactory::newTypeIDValue('_wpg', $title->getPrefixedText()); |
139 | 142 | $this->hashkey = $this->title_prefurl . ' ' . $modifier; // must agree with keys generated elsewhere in this code! |
140 | 143 | $this->modifier = $modifier; |
141 | 144 | if ($modifier != '') $modifier = '#' . $modifier; |
— | — | @@ -143,30 +146,16 @@ |
144 | 147 | $this->exists = $title->exists(); |
145 | 148 | |
146 | 149 | if ($this->exists) { |
147 | | - $res = $export->db->select($export->db->tableName('smw_specialprops'), |
148 | | - 'property_id, value_string', |
149 | | - 'subject_id =' . $export->db->addQuotes($this->title_id), |
150 | | - 'SMWExportTitle::newFromID'); |
151 | | - while($row = $export->db->fetchObject($res)) { // read out relevant special props |
152 | | - switch ($row->property_id) { |
153 | | - case SMW_SP_HAS_TYPE: |
154 | | - $this->has_type = $row->value_string; |
155 | | - break; |
156 | | - case SMW_SP_HAS_URI: |
157 | | - $this->has_uri = $row->value_string; |
158 | | - break; |
159 | | - case SMW_SP_EXT_BASEURI: |
160 | | - $this->ns_uri = $row->value_string; |
161 | | - break; |
162 | | - case SMW_SP_EXT_NSID: |
163 | | - $this->ext_nsid = $row->value_string; |
164 | | - break; |
165 | | - case SMW_SP_EXT_SECTION: |
166 | | - $this->ext_section = $row->value_string; |
167 | | - break; |
168 | | - } |
| 150 | + if ($title->getNamespace() == SMW_NS_ATTRIBUTE) { |
| 151 | + $a = $export->store->getSpecialValues( $title, SMW_SP_HAS_TYPE ); |
| 152 | + if (count($a)>0) $this->has_type = $a[0]; |
169 | 153 | } |
170 | | - $export->db->freeResult($res); |
| 154 | + $a = $export->store->getSpecialValues( $title, SMW_SP_EXT_BASEURI ); |
| 155 | + if (count($a)>0) $this->ns_uri = $a[0]; |
| 156 | + $a = $export->store->getSpecialValues( $title, SMW_SP_EXT_NSID ); |
| 157 | + if (count($a)>0) $this->ext_nsid = $a[0]; |
| 158 | + $a = $export->store->getSpecialValues( $title, SMW_SP_EXT_SECTION ); |
| 159 | + if (count($a)>0) $this->ext_section = $a[0]; |
171 | 160 | } |
172 | 161 | |
173 | 162 | // Calculate URIs and label |
— | — | @@ -254,9 +243,9 @@ |
255 | 244 | var $special_url; |
256 | 245 | |
257 | 246 | /** |
258 | | - * Database handler -- needed multiple times, so "cache" it |
| 247 | + * Store handler -- needed multiple times, so "cache" it |
259 | 248 | */ |
260 | | - var $db; |
| 249 | + var $store; |
261 | 250 | |
262 | 251 | /** |
263 | 252 | * Array of additional namespaces (abbreviation => URI), flushed on |
— | — | @@ -313,8 +302,6 @@ |
314 | 303 | global $wgServer; // actual server address (with http://) |
315 | 304 | global $wgScript; // "/subdirectory/of/wiki/index.php" |
316 | 305 | global $wgArticlePath; |
317 | | - //@TODO: generate this properly, using $wgArticlePath DONE, please check |
318 | | - //$this->wiki_xmlns_url = $wgServer . $wgScript . '/'; |
319 | 306 | $this->wiki_xmlns_url = $wgServer . str_replace('$1', '', $wgArticlePath); |
320 | 307 | if (''==$smwgNamespace) { |
321 | 308 | $resolver = Title::makeTitle( NS_SPECIAL, 'URIResolver'); |
— | — | @@ -344,7 +331,7 @@ |
345 | 332 | * properties are exported as well. Enables "browsable RDF." |
346 | 333 | */ |
347 | 334 | public function printPages($pages, $recursion = 1, $backlinks = true) { |
348 | | - $this->db = & wfGetDB( DB_MASTER ); |
| 335 | + $this->store = &smwfGetStore(); |
349 | 336 | $this->pre_ns_buffer = ''; |
350 | 337 | $this->post_ns_buffer = ''; |
351 | 338 | $this->first_flush = true; |
— | — | @@ -376,24 +363,20 @@ |
377 | 364 | } |
378 | 365 | // possibly add backlinks |
379 | 366 | if ($backlinks === true) { |
380 | | - $res = $this->db->query( |
381 | | - 'SELECT DISTINCT subject_id FROM ' . $this->db->tableName('smw_relations') . |
382 | | - ' WHERE object_title=' . $this->db->addQuotes($et->title_dbkey) . |
383 | | - ' AND object_namespace=' . $this->db->addQuotes($et->title_namespace), |
384 | | - 'SMWExportRDF::printPages'); |
385 | | - while($row = $this->db->fetchObject($res)) { |
386 | | - $st = $this->getExportTitleFromID($row->subject_id); |
387 | | - if (!array_key_exists($st->hashkey, $this->element_done)) { |
388 | | - $cur_queue[] = $st; |
| 367 | + $inRels = $this->store->getInProperties( $et->value ); |
| 368 | + foreach ($inRels as $inRel) { |
| 369 | + $inSubs = $this->store->getPropertySubjects( $inRel, $et->value ); |
| 370 | + foreach($inSubs as $inSub) { |
| 371 | + $st = $this->getExportTitleFromTitle( $inSub ); |
| 372 | + if (!array_key_exists($st->hashkey, $this->element_done)) { |
| 373 | + $cur_queue[] = $st; |
| 374 | + } |
389 | 375 | } |
390 | 376 | } |
391 | 377 | if ( NS_CATEGORY === $et->title_namespace ) { // also print elements of categories |
392 | | - $res = $this->db->query( |
393 | | - 'SELECT cl_from FROM ' . $this->db->tableName('categorylinks') . |
394 | | - ' WHERE cl_to=' . $this->db->addQuotes($et->title_dbkey), |
395 | | - 'SMWExportRDF::printPages'); |
396 | | - while($row = $this->db->fetchObject($res)) { |
397 | | - $st = $this->getExportTitleFromID($row->cl_from); |
| 378 | + $instances = $this->store->getSpecialSubjects( SMW_SP_HAS_CATEGORY, $et->title ); |
| 379 | + foreach($instances as $instance) { |
| 380 | + $st = $this->getExportTitleFromTitle( $instance ); |
398 | 381 | if (!array_key_exists($st->hashkey, $this->element_done)) { |
399 | 382 | $cur_queue[] = $st; |
400 | 383 | } |
— | — | @@ -430,7 +413,8 @@ |
431 | 414 | global $smwgNamespacesWithSemanticLinks; |
432 | 415 | $linkCache =& LinkCache::singleton(); |
433 | 416 | |
434 | | - $this->db = & wfGetDB( DB_MASTER ); |
| 417 | + $db = & wfGetDB( DB_MASTER ); |
| 418 | + $this->store = & smwfGetStore(); |
435 | 419 | $this->pre_ns_buffer = ''; |
436 | 420 | $this->post_ns_buffer = ''; |
437 | 421 | $this->first_flush = true; |
— | — | @@ -450,7 +434,7 @@ |
451 | 435 | $this->printHeader(); // also inits global namespaces |
452 | 436 | |
453 | 437 | $start = 1; |
454 | | - $end = $this->db->selectField( 'page', 'max(page_id)', false, $fname ); |
| 438 | + $end = $db->selectField( 'page', 'max(page_id)', false, $outfile ); |
455 | 439 | |
456 | 440 | $a_count = 0; $d_count = 0; //DEBUG |
457 | 441 | |
— | — | @@ -587,11 +571,10 @@ |
588 | 572 | break; |
589 | 573 | case SMW_NS_ATTRIBUTE: |
590 | 574 | if ( $et->has_type === false ) return; //attributes w/o type not exportable, TODO: is this what we want? |
591 | | - $datatype_handler = SMWTypeHandlerFactory::getTypeHandlerByLabel($et->has_type); |
592 | | - if ( ('annouri' == $datatype_handler->getID()) || ('annostring' == $datatype_handler->getID()) ) { |
| 575 | + if ( ('annouri' == $et->has_type->getTypeID()) || ('annostring' == $et->has_type->getTypeID()) ) { |
593 | 576 | $type = 'owl:AnnotationProperty'; // cannot be a subproperty, etc. |
594 | 577 | } else { |
595 | | - if ('' != $datatype_handler->getXSDType()) { |
| 578 | + if ('' != SMWTypeHandlerFactory::getXSDTypeByID($et->has_type->getTypeID())) { |
596 | 579 | $type = 'owl:DatatypeProperty'; |
597 | 580 | } else { // no xsd-type -> treat as object property |
598 | 581 | $type = 'owl:ObjectProperty'; |
— | — | @@ -633,12 +616,11 @@ |
634 | 617 | if ( ($fullexport) && ($et->exists) ) { |
635 | 618 | // add statements about categories |
636 | 619 | if ($category_rel) { |
637 | | - $res = $this->db->query( 'SELECT cl_to FROM ' . $this->db->tableName('categorylinks') . ' WHERE cl_from=' . $et->title_id, 'SMWExportRDF::printTriples'); |
638 | | - while($row = $this->db->fetchObject($res)) { |
639 | | - $ct = $this->getExportTitle($row->cl_to, NS_CATEGORY); |
| 620 | + $cats = $this->store->getSpecialValues( $et->title, SMW_SP_HAS_CATEGORY ); |
| 621 | + foreach ($cats as $cat) { |
| 622 | + $ct = $this->getExportTitleFromTitle( $cat ); |
640 | 623 | $this->post_ns_buffer .= "\t\t<" . $category_rel . ' rdf:resource="' . $ct->long_uri . "\"/>\n"; |
641 | 624 | } |
642 | | - $this->db->freeResult($res); |
643 | 625 | } |
644 | 626 | |
645 | 627 | // TODO: this is not convincing, esp. now that we have custom types |
— | — | @@ -661,7 +643,7 @@ |
662 | 644 | |
663 | 645 | // add rdfs:subPropertyOf statements |
664 | 646 | if ($subrel_rel) { |
665 | | - $relations = &smwfGetStore()->getSpecialValues($et->title, SMW_SP_SUBPROPERTY_OF); |
| 647 | + $relations = &smwfGetStore()->getSpecialValues($et->title, SMW_SP_SUBPROPERTY_OF); |
666 | 648 | foreach ($relations as $relation) { |
667 | 649 | // TODO in future, check type safety relations <-> attributes |
668 | 650 | // TODO check also the type of what I am pointing to (is it a relation or sth else?) |
— | — | @@ -673,7 +655,7 @@ |
674 | 656 | } |
675 | 657 | } |
676 | 658 | if ($subatt_rel) { |
677 | | - $attributes = &smwfGetStore()->getSpecialValues($et->title, SMW_SP_SUBPROPERTY_OF); |
| 659 | + $attributes = &smwfGetStore()->getSpecialValues($et->title, SMW_SP_SUBPROPERTY_OF); |
678 | 660 | foreach ($attributes as $attribute) { |
679 | 661 | // TODO in future, check type safety relations <-> attributes |
680 | 662 | // TODO check also the type of what I am pointing to (is it an atrribute or sth else?) |
— | — | @@ -690,32 +672,36 @@ |
691 | 673 | |
692 | 674 | if ($et->is_individual) { // do not print relations for schema elements, stay in OWL DL |
693 | 675 | // print all relations |
694 | | - $res = $this->db->query( 'SELECT relation_title, object_namespace, object_title FROM ' . $this->db->tableName('smw_relations') . ' WHERE subject_id=' . $et->title_id, 'SMWExportRDF::printTriples'); |
695 | | - while($row = $this->db->fetchObject($res)) { |
696 | | - $pt = $this->getExportTitle($row->relation_title, SMW_NS_RELATION); |
697 | | - $ot = $this->getExportTitle($row->object_title, $row->object_namespace); |
698 | | - if ($ot->is_individual) { // no OWL Full |
699 | | - $this->post_ns_buffer .= "\t\t<" . $pt->short_uri . ' rdf:resource="' . $ot->long_uri . "\"/>\n"; |
| 676 | + $props = $this->store->getProperties( $et->title ); |
| 677 | + foreach ( $props as $prop ) { |
| 678 | + $values = $this->store->getPropertyValues( $et->title, $prop ); |
| 679 | + foreach ( $values as $value ) { |
| 680 | + $pt = $this->getExportTitleFromTitle( $prop, $value->getUnit() ); |
| 681 | + $this-> post_ns_buffer .= $value->exportToRDF( $pt->short_uri, $this ); |
| 682 | +// $ot = $this->getExportTitleFromTitle( $obj ); |
| 683 | +// if ($ot->is_individual) { // check OWL Fullness |
| 684 | +// $this->post_ns_buffer .= "\t\t<" . $pt->short_uri . ' rdf:resource="' . $ot->long_uri . "\"/>\n"; |
| 685 | +// } |
700 | 686 | } |
701 | 687 | } |
702 | 688 | // print all attributes |
703 | | - $res = $this->db->query( 'SELECT attribute_title, value_unit, value_datatype, value_xsd FROM ' . $this->db->tableName('smw_attributes') . ' WHERE subject_id=' . $et->title_id, 'SMWExportRDF::printTriples'); |
704 | | - while($row = $this->db->fetchObject($res)) { |
705 | | - $pt = $this->getExportTitle($row->attribute_title, SMW_NS_ATTRIBUTE, $row->value_unit); |
706 | | - // check whether attribute type has changed since data was stored: |
707 | | - if ( ($pt->has_type !== false) && |
708 | | - ($row->value_datatype !== SMWTypeHandlerFactory::getTypeHandlerByLabel($pt->has_type)->getID() ) ) |
709 | | - continue; |
710 | | - $xsdtype = SMWTypeHandlerFactory::getXSDTypeByID($row->value_datatype); |
711 | | - if ( ($xsdtype !== '') && ($xsdtype !== NULL) ) { |
712 | | - $this->post_ns_buffer .= "\t\t<" . $pt->short_uri . ' rdf:datatype="' . $xsdtype . '">' . $row->value_xsd . '</' . $pt->short_uri . ">\n"; |
713 | | - } elseif ($xsdtype === '') { // no xsd-type -> export as object property |
714 | | - $this->post_ns_buffer .= "\t\t<" . $pt->short_uri . ' rdf:resource="' . $row->value_xsd . "\"/>\n"; |
715 | | - } else { |
716 | | - $this->post_ns_buffer .= "<!-- Sorry, type '$row->value_datatype' of attribute '$pt->label' could not be resolved to XSD. Probably an upgrade issue. Try saving the respective article again. -->"; |
| 689 | +/* $atts = $this->store->getAttributes( $et->title ); |
| 690 | + foreach ( $atts as $att ) { |
| 691 | + $dvs = $this->store->getAttributeValues( $et->title, $att ); |
| 692 | + foreach ( $dvs as $dv ) { |
| 693 | + $pt = $this->getExportTitleFromTitle( $att, $dv->getUnit() ); |
| 694 | + $xsdtype = SMWTypeHandlerFactory::getXSDTypeByID( $dv->getTypeID() ); |
| 695 | + $xsdvalue = $dv->getXSDValue(); |
| 696 | + if ( ($xsdtype !== '') && ($xsdtype !== NULL) && ($xsdvalue != '') ) { |
| 697 | + $this->post_ns_buffer .= "\t\t<" . $pt->short_uri . ' rdf:datatype="' . $xsdtype . '">' . $xsdvalue . '</' . $pt->short_uri . ">\n"; |
| 698 | + } elseif ($xsdtype === '') { // no xsd-type -> export as object property |
| 699 | + $this->post_ns_buffer .= "\t\t<" . $pt->short_uri . ' rdf:resource="' . $xsdvalue . "\"/>\n"; |
| 700 | + } else { |
| 701 | + $this->post_ns_buffer .= "\t\t<!-- Sorry, type '$xsdtype' of attribute '$pt->label' could not be resolved to XSD. Probably an upgrade issue. Try saving the respective article again. -->\n"; |
| 702 | + } |
717 | 703 | } |
718 | 704 | } |
719 | | - } |
| 705 | +*/ } |
720 | 706 | } |
721 | 707 | |
722 | 708 | $this->post_ns_buffer .= "\t</" . $type . ">\n"; |
— | — | @@ -762,7 +748,23 @@ |
763 | 749 | $this->extra_namespaces[$nsshort] = $nsuri; |
764 | 750 | } |
765 | 751 | } |
| 752 | + |
| 753 | + /** |
| 754 | + * Returns the exportable QName of a page. |
| 755 | + */ |
| 756 | + public function getQName(Title $title, $unit = '') { |
| 757 | + $et = $this->getExportTitleFromTitle( $title, $unit ); |
| 758 | + return $et->long_uri; |
| 759 | + } |
766 | 760 | |
| 761 | + /** |
| 762 | + * Returns the exportable URL of a page. |
| 763 | + */ |
| 764 | + public function getURI(Title $title, $unit = '') { |
| 765 | + $et = $this->getExportTitleFromTitle( $title, $unit ); |
| 766 | + return $et->short_uri; |
| 767 | + } |
| 768 | + |
767 | 769 | /** Fetch SMWExportTitle for a given article. The inputs are |
768 | 770 | * $text -- standard text form of the main part of the article name |
769 | 771 | * (no namespace, no urlencode) |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DataValue.php |
— | — | @@ -70,8 +70,8 @@ |
71 | 71 | /** |
72 | 72 | * Define a particular output format. Output formats are user-supplied strings |
73 | 73 | * that the datavalue may (or may not) use to customise its return value. For |
74 | | - * example, quantities with units of measurement may interpret the string as |
75 | | - * a desired output unit. In other cases, the output format might be built-in |
| 74 | + * example, quantities with units of measurement may interpret the string as |
| 75 | + * a desired output unit. In other cases, the output format might be built-in |
76 | 76 | * and subject to internationalisation (which the datavalue has to implement). |
77 | 77 | * In any case, an empty string resets the output format to the default. |
78 | 78 | */ |
— | — | @@ -96,7 +96,7 @@ |
97 | 97 | |
98 | 98 | /** |
99 | 99 | * Initialise the datavalue from the given value string and unit. |
100 | | - * The format of both strings strictly corresponds to the output |
| 100 | + * The format of both strings strictly corresponds to the output |
101 | 101 | * of this implementation for getXSDValue() and getUnit(). |
102 | 102 | */ |
103 | 103 | abstract protected function parseXSDValue($value, $unit); |
— | — | @@ -158,7 +158,7 @@ |
159 | 159 | /** |
160 | 160 | * Return the plain wiki version of the value, or |
161 | 161 | * FALSE if no such version is available. The returned |
162 | | - * string suffices to reobtain the same DataValue |
| 162 | + * string suffices to reobtain the same DataValue |
163 | 163 | * when passing it as an input string to setUserValue(). |
164 | 164 | * Thus it also includes units, if any. |
165 | 165 | */ |
— | — | @@ -237,6 +237,20 @@ |
238 | 238 | public function getErrors() { |
239 | 239 | return $this->m_errors; |
240 | 240 | } |
| 241 | + |
| 242 | + /** |
| 243 | + * Exports the datavalue to RDF (i.e. it returns a string that consists |
| 244 | + * of the lines that, in RDF/XML, can be fitted between the object-tags. |
| 245 | + * This should be overwritten. |
| 246 | + * QName -- the qualified name that the data value should use for exporting, |
| 247 | + * since it may be an imported name. |
| 248 | + * Exporter -- the exporting object |
| 249 | + * TODO make it an abstract function? Not sure. |
| 250 | + */ |
| 251 | + public function exportToRDF($QName, ExportRDF $exporter) { |
| 252 | + $type = $this->getTypeID(); |
| 253 | + return "\t\t<!-- Sorry, unknown how to export type '$type'. -->\n"; |
| 254 | + } |
241 | 255 | |
242 | 256 | /*********************************************************************/ |
243 | 257 | /* Static methods for initialisation */ |
— | — | @@ -246,7 +260,7 @@ |
247 | 261 | * Create a value from a string supplied by a user for a given attribute. |
248 | 262 | * If no value is given, an empty container is created, the value of which |
249 | 263 | * can be set later on. |
250 | | - * |
| 264 | + * |
251 | 265 | * @DEPRECATED |
252 | 266 | */ |
253 | 267 | static function newAttributeValue($attribute, $value=false) { |
— | — | @@ -256,7 +270,7 @@ |
257 | 271 | |
258 | 272 | /** |
259 | 273 | * Create a value from a string supplied by a user for a given special |
260 | | - * property, encoded as a numeric constant. |
| 274 | + * property, encoded as a numeric constant. |
261 | 275 | * If no value is given, an empty container is created, the value of which |
262 | 276 | * can be set later on. |
263 | 277 | * |
— | — | @@ -271,14 +285,14 @@ |
272 | 286 | * Create a value from a user-supplied string for which a type handler is known |
273 | 287 | * If no value is given, an empty container is created, the value of which |
274 | 288 | * can be set later on. |
275 | | - * |
| 289 | + * |
276 | 290 | * @DEPRECATED |
277 | 291 | */ |
278 | 292 | static function newTypedValue(SMWTypeHandler $type, $value=false) { |
279 | 293 | trigger_error("The function SMWDataValue::newTypedValue() is deprecated.", E_USER_NOTICE); |
280 | 294 | return SMWDataValueFactory::newTypeHandlerValue($type, $value); |
281 | 295 | } |
282 | | - |
| 296 | + |
283 | 297 | /*********************************************************************/ |
284 | 298 | /* Legacy methods for compatiblity */ |
285 | 299 | /*********************************************************************/ |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DV_WikiPage.php |
— | — | @@ -1,7 +1,7 @@ |
2 | 2 | <?php |
3 | 3 | /** |
4 | 4 | * This datavalue implements special processing suitable for defining |
5 | | - * wikipages as values of properties. This value container currently |
| 5 | + * wikipages as values of properties. This value container currently |
6 | 6 | * behaves somewhat special in that its xsdvalue is not containint all |
7 | 7 | * relevant information (it just gives the DB-Key, not the namespace). |
8 | 8 | * TODO: This should change, but is not really critical now. |
— | — | @@ -128,6 +128,11 @@ |
129 | 129 | return false; |
130 | 130 | } |
131 | 131 | |
| 132 | + public function exportToRDF($QName, ExportRDF $exporter) { |
| 133 | + $obj = $exporter->getURI( $this->getTitle() ); |
| 134 | + return "\t\t<$QName rdf:resource=\"$obj\" />\n"; |
| 135 | + } |
| 136 | + |
132 | 137 | ///// special interface for wiki page values |
133 | 138 | |
134 | 139 | /** |
— | — | @@ -204,4 +209,4 @@ |
205 | 210 | } |
206 | 211 | } |
207 | 212 | |
208 | | -?> |
\ No newline at end of file |
| 213 | +?> |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DV_String.php |
— | — | @@ -3,7 +3,7 @@ |
4 | 4 | /** |
5 | 5 | * This datavalue implements String-Datavalues suitable for defining |
6 | 6 | * String-types of properties. |
7 | | - * |
| 7 | + * |
8 | 8 | * @author: Nikolas Iwan |
9 | 9 | */ |
10 | 10 | class SMWStringValue extends SMWDataValue { |
— | — | @@ -67,11 +67,11 @@ |
68 | 68 | public function getXSDValue() { |
69 | 69 | return $this->m_xsdvalue; |
70 | 70 | } |
71 | | - |
| 71 | + |
72 | 72 | public function getWikiValue(){ |
73 | 73 | return $this->m_value; |
74 | 74 | } |
75 | | - |
| 75 | + |
76 | 76 | public function getNumericValue() { |
77 | 77 | return NULL; |
78 | 78 | } |
— | — | @@ -88,5 +88,8 @@ |
89 | 89 | return false; |
90 | 90 | } |
91 | 91 | |
| 92 | + public function exportToRDF($QName, ExportRDF $exporter) { |
| 93 | + return "\t\t<$QName rdf:datatype=\"http://www.w3.org/2001/XMLSchema#string\">$this->m_xsdvalue</$QName>\n"; |
| 94 | + } |
92 | 95 | |
93 | 96 | } |