Index: trunk/extensions/SemanticMediaWiki/specials/ExportRDF/SMW_SpecialExportRDF.php |
— | — | @@ -282,7 +282,7 @@ |
283 | 283 | private $global_namespaces; |
284 | 284 | |
285 | 285 | /** |
286 | | - * Array of references to the SMW schema. Will be added at the end of the |
| 286 | + * Array of references to the SWIVT schema. Will be added at the end of the |
287 | 287 | * export. |
288 | 288 | */ |
289 | 289 | private $schema_refs; |
— | — | @@ -551,8 +551,7 @@ |
552 | 552 | "\t<!ENTITY rdf 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'>\n" . |
553 | 553 | "\t<!ENTITY rdfs 'http://www.w3.org/2000/01/rdf-schema#'>\n" . |
554 | 554 | "\t<!ENTITY owl 'http://www.w3.org/2002/07/owl#'>\n" . |
555 | | - "\t<!ENTITY smw 'http://smw.ontoware.org/2005/smw#'>\n" . |
556 | | - "\t<!ENTITY smwdt 'http://smw.ontoware.org/2005/smw-datatype#'>\n" . |
| 555 | + "\t<!ENTITY swivt 'http://semantic-mediawiki.org/swivt/1.0#'>\n" . |
557 | 556 | // A note on "wiki": this namespace is crucial as a fallback when it would be illegal to start e.g. with a number. In this case, one can always use wiki:... followed by "_" and possibly some namespace, since _ is legal as a first character. |
558 | 557 | "\t<!ENTITY wiki '" . $this->wiki_xmlns_xml . "'>\n" . |
559 | 558 | "\t<!ENTITY property '" . $this->wiki_xmlns_xml . |
— | — | @@ -563,20 +562,21 @@ |
564 | 563 | "\txmlns:rdf=\"&rdf;\"\n" . |
565 | 564 | "\txmlns:rdfs=\"&rdfs;\"\n" . |
566 | 565 | "\txmlns:owl =\"&owl;\"\n" . |
567 | | - "\txmlns:smw=\"&smw;\"\n" . |
| 566 | + "\txmlns:swivt=\"&swivt;\"\n" . |
568 | 567 | "\txmlns:wiki=\"&wiki;\"\n" . |
569 | 568 | "\txmlns:property=\"&property;\""; |
570 | | - $this->global_namespaces = array('rdf'=>true, 'rdfs'=>true, 'owl'=>true, 'smw'=>true, 'wiki'=>true, 'property'=>true); |
| 569 | + $this->global_namespaces = array('rdf'=>true, 'rdfs'=>true, 'owl'=>true, 'swivt'=>true, 'wiki'=>true, 'property'=>true); |
571 | 570 | |
572 | 571 | $this->post_ns_buffer .= |
573 | 572 | ">\n\t<!-- Ontology header -->\n" . |
574 | 573 | "\t<owl:Ontology rdf:about=\"\">\n" . |
575 | | - "\t\t<smw:exportDate rdf:datatype=\"http://www.w3.org/2001/XMLSchema#dateTime\">" . date(DATE_W3C) . "</smw:exportDate>\n" . |
| 574 | + "\t\t<swivt:creationDate rdf:datatype=\"http://www.w3.org/2001/XMLSchema#dateTime\">" . date(DATE_W3C) . "</swivt:creationDate>\n" . |
| 575 | + "\t\t<owl:imports rdf:resource=\"http://semantic-mediawiki.org/swivt/1.0\" />\n" . |
576 | 576 | "\t</owl:Ontology>\n" . |
577 | 577 | "\t<!-- exported page data -->\n"; |
578 | | - $this->addSchemaRef( "hasArticle", "owl:AnnotationProperty" ); |
579 | | - $this->addSchemaRef( "exportDate", "owl:AnnotationProperty" ); |
580 | | - $this->addSchemaRef( "Thing", "owl:Class" ); |
| 578 | + $this->addSchemaRef( "page", "owl:AnnotationProperty" ); |
| 579 | + $this->addSchemaRef( "creationDate", "owl:AnnotationProperty" ); |
| 580 | + $this->addSchemaRef( "Subject", "owl:Class" ); |
581 | 581 | } |
582 | 582 | |
583 | 583 | /** |
— | — | @@ -588,20 +588,20 @@ |
589 | 589 | foreach (array_keys($this->schema_refs) as $name) { |
590 | 590 | $type = $this->schema_refs[$name]; |
591 | 591 | $this->post_ns_buffer .= |
592 | | - "\t<$type rdf:about=\"&smw;$name\">\n" . |
593 | | - "\t\t<rdfs:isDefinedBy rdf:resource=\"http://smw.ontoware.org/2005/smw\"/>\n" . |
| 592 | + "\t<$type rdf:about=\"&swivt;$name\">\n" . |
| 593 | + "\t\t<rdfs:isDefinedBy rdf:resource=\"http://semantic-mediawiki.org/swivt/1.0\"/>\n" . |
594 | 594 | "\t</$type>\n"; |
595 | 595 | } |
596 | | - $this->post_ns_buffer .= "\t<!-- Created with Semantic MediaWiki, http://ontoworld.org/wiki/SMW -->\n"; |
| 596 | + $this->post_ns_buffer .= "\t<!-- Created with Semantic MediaWiki, http://semantic-mediawiki.org -->\n"; |
597 | 597 | $this->post_ns_buffer .= '</rdf:RDF>'; |
598 | 598 | } |
599 | 599 | |
600 | 600 | /** |
601 | | - * Adds a reference to the SMW schema. This will make sure that at the end of the page, |
| 601 | + * Adds a reference to the SWIVT schema. This will make sure that at the end of the page, |
602 | 602 | * all required schema references will be defined and point to the appropriate ontology. |
603 | 603 | * |
604 | 604 | * @param string $name The fragmend identifier of the entity to be referenced. |
605 | | - * The SMW namespace is assumed. |
| 605 | + * The SWIVT namespace is added. |
606 | 606 | * @param string $type The type of the referenced identifier, i.e. is it an annotation |
607 | 607 | * property, an object property, a class, etc. Should be given as a QName |
608 | 608 | * (i.e. in the form "owl:Class", etc.) |
— | — | @@ -649,12 +649,7 @@ |
650 | 650 | switch ($et->title_namespace) { |
651 | 651 | case SMW_NS_PROPERTY: |
652 | 652 | $equality_rel = "owl:equivalentProperty"; |
653 | | - global $smwgExportSemanticRelationHierarchy; |
654 | | - if ($smwgExportSemanticRelationHierarchy) { |
655 | | - $subprop_rel = "rdfs:subPropertyOf"; |
656 | | - } else { |
657 | | - $subprop_rel = "smw:subPropertyOf"; |
658 | | - } |
| 653 | + $subprop_rel = "rdfs:subPropertyOf"; |
659 | 654 | |
660 | 655 | switch ($et->has_type) { |
661 | 656 | case '': case '_wpg': case '_uri': case '_ema': case '__nry': |
— | — | @@ -677,7 +672,7 @@ |
678 | 673 | $equality_rel = "owl:equivalentClass"; |
679 | 674 | break; |
680 | 675 | default: |
681 | | - $type = 'smw:Thing'; |
| 676 | + $type = 'swivt:Subject'; |
682 | 677 | $category_rel = "rdf:type"; |
683 | 678 | $equality_rel = "owl:sameAs"; |
684 | 679 | break; |
— | — | @@ -691,23 +686,23 @@ |
692 | 687 | } |
693 | 688 | $this->post_ns_buffer .= ">\n" . |
694 | 689 | "\t\t<rdfs:label>" . $et->label . "</rdfs:label>\n" . |
695 | | - "\t\t<smw:hasArticle rdf:resource=\"&wikiurl;" . |
| 690 | + "\t\t<swivt:page rdf:resource=\"&wikiurl;" . |
696 | 691 | $et->title_prefurl . "\"/>\n" . |
697 | 692 | "\t\t<rdfs:isDefinedBy rdf:resource=\"" . |
698 | 693 | $this->special_url . '/' . $et->title_prefurl . "\"/>\n"; |
699 | 694 | // If the property is modified by a unit, export the modifier |
700 | 695 | // and the base relation explicitly |
701 | 696 | if ( $et->has_type && $et->modifier ) { |
702 | | - $this->post_ns_buffer .= "\t\t<smw:hasModifier rdf:datatype=\"http://www.w3.org/2001/XMLSchema#string\">" . |
| 697 | + $this->post_ns_buffer .= "\t\t<swivt:modifier rdf:datatype=\"http://www.w3.org/2001/XMLSchema#string\">" . |
703 | 698 | smwfXMLContentEncode($et->modifier) . |
704 | | - "</smw:hasModifier>\n"; |
| 699 | + "</swivt:modifier>\n"; |
705 | 700 | $baseprop = $this->getExportTitle($et->title_text, SMW_NS_PROPERTY); |
706 | | - $this->post_ns_buffer .= "\t\t<smw:baseProperty rdf:resource=\"" . $baseprop->long_uri . "\"/>\n"; |
| 701 | + $this->post_ns_buffer .= "\t\t<swivt:baseProperty rdf:resource=\"" . $baseprop->long_uri . "\"/>\n"; |
707 | 702 | if (!array_key_exists($baseprop->hashkey, $this->element_queue)) { |
708 | 703 | $this->element_queue[$baseprop->hashkey] = $baseprop; |
709 | 704 | } |
710 | 705 | $this->addSchemaRef( "baseProperty", "owl:AnnotationProperty" ); |
711 | | - $this->addSchemaRef( "hasModifier", "owl:AnnotationProperty" ); |
| 706 | + $this->addSchemaRef( "modifier", "owl:AnnotationProperty" ); |
712 | 707 | } |
713 | 708 | |
714 | 709 | if ( ($fullexport) && ($et->exists) ) { |
— | — | @@ -721,10 +716,10 @@ |
722 | 717 | } |
723 | 718 | |
724 | 719 | // TODO: this is not convincing, esp. now that we have custom types |
725 | | - if (isset($datatype_handler)) { |
726 | | - $this->post_ns_buffer .= "\t\t<smw:hasType " . 'rdf:resource="&smwdt;' . $datatype_handler->getID() . "\"/>\n"; |
727 | | - $this->addSchemaRef( "hasType", "owl:AnnotationProperty" ); |
728 | | - } |
| 720 | +// if (isset($datatype_handler)) { |
| 721 | +// $this->post_ns_buffer .= "\t\t<swivt:type " . 'rdf:resource="&??;' . $datatype_handler->getID() . "\"/>\n"; |
| 722 | +// $this->addSchemaRef( "type", "owl:AnnotationProperty" ); |
| 723 | +// } |
729 | 724 | |
730 | 725 | // add statements about equivalence to (external) URIs |
731 | 726 | // FIXME: temporarily disabled |
— | — | @@ -753,8 +748,6 @@ |
754 | 749 | if (!array_key_exists($supprop->hashkey, $this->element_queue)) { |
755 | 750 | $this->element_queue[$supprop->hashkey] = $supprop; |
756 | 751 | } |
757 | | - if (!$smwgExportSemanticRelationHierarchy) |
758 | | - $this->addSchemaRef( "subPropertyOf", "owl:AnnotationProperty"); |
759 | 752 | } |
760 | 753 | } |
761 | 754 | |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Settings.php |
— | — | @@ -102,9 +102,6 @@ |
103 | 103 | ## |
104 | 104 | $smwgAllowRecursiveExport = false; // can normal users request recursive export? |
105 | 105 | $smwgExportBacklinks = true; // should backlinks be included by default? |
106 | | -$smwgExportSemanticRelationHierarchy = false; // should subrelations be exported with or wo semantics? |
107 | | -// as long as the underlying implementation does not support the semantics the export |
108 | | -// should reflect the same. |
109 | 106 | $smwgOWLFullExport = false; // decides, if the RDF export will export, by default, |
110 | 107 | // OWL Full or rather nice OWL DL. Can be overriden in the RDF export class. |
111 | 108 | // global $smwgNamespace; // The Namespace of exported URIs. |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DV_NAry.php |
— | — | @@ -358,7 +358,7 @@ |
359 | 359 | */ |
360 | 360 | public function exportToRDF( $QName, ExportRDF $exporter ) { |
361 | 361 | $rdf = "\t\t<$QName>\n"; |
362 | | - $rdf.= "\t\t\t<smw:NAry>\n"; |
| 362 | + $rdf.= "\t\t\t<swivt:Container>\n"; |
363 | 363 | $count = 0; |
364 | 364 | foreach ($this->m_values as $value) { |
365 | 365 | $count++; |
— | — | @@ -366,17 +366,17 @@ |
367 | 367 | continue; |
368 | 368 | } |
369 | 369 | if (($value->getTypeID() == '_wpg') || ($value->getTypeID() == '_uri') || ($value->getTypeID() == '_ema')) { |
370 | | - $element = "nary" . $count . "o"; |
371 | | - $rdf .= "\t\t" . $value->exportToRDF( "smw:$element", $exporter ); |
| 370 | + $element = "object" . $count; |
| 371 | + $rdf .= "\t\t" . $value->exportToRDF( "swivt:$element", $exporter ); |
372 | 372 | $exporter->addSchemaRef( $element, "owl:ObjectProperty" ); |
373 | 373 | } else { |
374 | | - $element = "nary" . $count; |
375 | | - $rdf .= "\t\t" . $value->exportToRDF( "smw:$element", $exporter ); |
| 374 | + $element = "value" . $count; |
| 375 | + $rdf .= "\t\t" . $value->exportToRDF( "swivt:$element", $exporter ); |
376 | 376 | $exporter->addSchemaRef( $element, "owl:DatatypeProperty" ); |
377 | 377 | } |
378 | 378 | } |
379 | | - $rdf .= "\t\t\t</smw:NAry>\n"; |
380 | | - $exporter->addSchemaRef( "NAry", "owl:Class" ); |
| 379 | + $rdf .= "\t\t\t</swivt:Container>\n"; |
| 380 | + $exporter->addSchemaRef( "Container", "owl:Class" ); |
381 | 381 | $rdf .= "\t\t</$QName>\n"; |
382 | 382 | return $rdf; |
383 | 383 | } |
Property changes on: trunk/extensions/SemanticMediaWiki |
___________________________________________________________________ |
Added: svn:ignore |
384 | 384 | + .project
|
.settings
|