Index: trunk/extensions/SemanticMediaWiki/includes/export/SMW_Exp_Element.php |
— | — | @@ -65,8 +65,6 @@ |
66 | 66 | protected $m_namespace = false; |
67 | 67 | protected $m_namespaceid = false; |
68 | 68 | protected $m_localname = false; |
69 | | - protected $m_modifier = ''; // "modifier" string: resources might refer to a wiki page, |
70 | | - // but many resources may refer to the same page, using different modifiers (e.g.: unit strings) |
71 | 69 | |
72 | 70 | /** |
73 | 71 | * Constructor. $dv is the SMWDataValue from which this object was created, |
— | — | @@ -93,37 +91,6 @@ |
94 | 92 | } |
95 | 93 | |
96 | 94 | /** |
97 | | - * SMW uses URI-Refs (#) to make "variants" of some base URI, e.g. to create multiple |
98 | | - * versions of a property to store values with multiple units of measurement. This function |
99 | | - * creates such a variant based on a given string label (e.g. unit) and returns a stuitable |
100 | | - * SMWExpResource. |
101 | | - */ |
102 | | - public function makeVariant( $modifier ) { |
103 | | - if ( $this->m_namespace != false ) { |
104 | | - $result = new SMWExpResource( $this->m_localname . SMWExporter::encodeURI( urlencode( str_replace( ' ', '_', '#' . $modifier ) ) ), |
105 | | - $this->m_dv, $this->m_namespace, $this->m_namespaceid ); |
106 | | - } else { |
107 | | - $result = new SMWExpResource( $this->m_name . SMWExporter::encodeURI( urlencode( str_replace( ' ', '_', '#' . $modifier ) ) ), $this->m_dv ); |
108 | | - } |
109 | | - $result->setModifier( $modifier ); |
110 | | - return $result; |
111 | | - } |
112 | | - |
113 | | - /** |
114 | | - * See comment for SMWExpResource::m_modifier and SMWExpResource::makeVariant(). |
115 | | - */ |
116 | | - public function setModifier( $modifier ) { |
117 | | - $this->m_modifier = $modifier; |
118 | | - } |
119 | | - |
120 | | - /** |
121 | | - * See comment for SMWExpResource::m_modifier and SMWExpResource::makeVariant(). |
122 | | - */ |
123 | | - public function getModifier() { |
124 | | - return $this->m_modifier; |
125 | | - } |
126 | | - |
127 | | - /** |
128 | 95 | * Return a qualitifed name for the element, or false if no such name could be found. |
129 | 96 | */ |
130 | 97 | public function getQName() { |
Index: trunk/extensions/SemanticMediaWiki/includes/export/SMW_ExportController.php |
— | — | @@ -162,7 +162,6 @@ |
163 | 163 | |
164 | 164 | foreach ( $data->getProperties() as $property ) { |
165 | 165 | if ( $property->getDataValue() instanceof SMWWikiPageValue ) { |
166 | | - // TODO This currently drops modifiers (units of measurement) |
167 | 166 | $this->queuePage( $property->getDataValue(), 0 ); // no real recursion along properties |
168 | 167 | } |
169 | 168 | $wikipagevalues = false; |
— | — | @@ -455,7 +454,7 @@ |
456 | 455 | $this->serializeSmallTitle( reset( $this->element_queue ) ); |
457 | 456 | // resolve dependencies that will otherwise not be printed |
458 | 457 | foreach ( $this->element_queue as $key => $staux ) { |
459 | | - if ( !smwfIsSemanticsProcessed( $staux->namespace ) || //( $staux->modifier !== '' ) || |
| 458 | + if ( !smwfIsSemanticsProcessed( $staux->namespace ) || |
460 | 459 | !SMWExportController::fitsNsRestriction( $ns_restriction, $staux->namespace ) ) { |
461 | 460 | // Note: we do not need to check the cache to guess if an element was already |
462 | 461 | // printed. If so, it would not be included in the queue in the first place. |
Index: trunk/extensions/SemanticMediaWiki/includes/export/SMW_Exporter.php |
— | — | @@ -42,18 +42,9 @@ |
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
46 | | - * Create exportable data from a given semantic data record. If given, the |
47 | | - * string $modifier is used as a modifier to the URI of the subject (e.g. a |
48 | | - * unit for properties). The function itself introduces modifiers for the |
49 | | - * SMWResourceElement objects that it creates to represent properties with |
50 | | - * units. When exporting further data for such properties recursively, |
51 | | - * these modifiers should be provided (they are not part of the |
52 | | - * SMWPageValue that is part of the SMWSemanticData object, since units are |
53 | | - * part of data values in SMW, but part of property names in the RDF export |
54 | | - * for better tool compatibility). This is the origin of all modifier |
55 | | - * strings that are used with this method. |
| 46 | + * Create exportable data from a given semantic data record. |
56 | 47 | */ |
57 | | - static public function makeExportData( /*SMWSemanticData*/ $semdata, $modifier = '' ) { |
| 48 | + static public function makeExportData( /*SMWSemanticData*/ $semdata ) { |
58 | 49 | SMWExporter::initBaseURIs(); |
59 | 50 | $subject = $semdata->getSubject(); |
60 | 51 | if ( $subject->getNamespace() == SMW_NS_PROPERTY ) { |
— | — | @@ -61,7 +52,7 @@ |
62 | 53 | } else { |
63 | 54 | $types = array(); |
64 | 55 | } |
65 | | - $result = SMWExporter::makeExportDataForSubject( $subject, $modifier, end( $types ) ); |
| 56 | + $result = SMWExporter::makeExportDataForSubject( $subject, end( $types ) ); |
66 | 57 | foreach ( $semdata->getProperties() as $property ) { |
67 | 58 | SMWExporter::addPropertyValues( $property, $semdata->getPropertyValues( $property ), $result ); |
68 | 59 | } |
— | — | @@ -71,17 +62,14 @@ |
72 | 63 | /** |
73 | 64 | * Make an SMWExpData object for the given page, and include the basic |
74 | 65 | * properties about this subject that are not directly represented by |
75 | | - * SMW property values. If given, the string $modifier is used as a |
76 | | - * modifier to the URI of the subject (e.g. a unit for properties). |
77 | | - * See also the documentation of makeExportData(). The optional parameter |
78 | | - * $typevalueforproperty can be used to pass a particular SMWTypesValue |
79 | | - * object that is used for determining the OWL type for property pages. |
| 66 | + * SMW property values. The optional parameter $typevalueforproperty |
| 67 | + * can be used to pass a particular SMWTypesValue object that is used |
| 68 | + * for determining the OWL type for property pages. |
80 | 69 | * |
81 | 70 | * @param SMWWikiPageValue $subject |
82 | | - * @param string $modifier |
83 | 71 | * @param mixed $typesvalueforproperty either an SMWTypesValue or null |
84 | 72 | */ |
85 | | - static public function makeExportDataForSubject( SMWWikiPageValue $subject, $modifier = '', $typesvalueforproperty = null ) { |
| 73 | + static public function makeExportDataForSubject( SMWWikiPageValue $subject, $typesvalueforproperty = null ) { |
86 | 74 | $result = $subject->getExportData(); |
87 | 75 | switch ( $subject->getNamespace() ) { |
88 | 76 | case NS_CATEGORY: case SMW_NS_CONCEPT: |
— | — | @@ -100,10 +88,6 @@ |
101 | 89 | $label = $subject->getWikiValue(); |
102 | 90 | $maintype_pe = SMWExporter::getSpecialElement( 'swivt', 'Subject' ); |
103 | 91 | } |
104 | | - if ( $modifier != '' ) { |
105 | | - $modifier = smwfHTMLtoUTF8( $modifier ); ///TODO: check if this is still needed |
106 | | - $label .= ' (' . $modifier . ')'; |
107 | | - } |
108 | 92 | $ed = new SMWExpData( new SMWExpLiteral( $label ) ); |
109 | 93 | $subj_title = $subject->getTitle(); |
110 | 94 | $result->addPropertyObjectValue( SMWExporter::getSpecialElement( 'rdfs', 'label' ), $ed ); |
— | — | @@ -114,14 +98,6 @@ |
115 | 99 | $result->addPropertyObjectValue( SMWExporter::getSpecialElement( 'rdf', 'type' ), new SMWExpData( $maintype_pe ) ); |
116 | 100 | $ed = new SMWExpData( new SMWExpLiteral( $subject->getNamespace(), null, 'http://www.w3.org/2001/XMLSchema#integer' ) ); |
117 | 101 | $result->addPropertyObjectValue( SMWExporter::getSpecialElement( 'swivt', 'wikiNamespace' ), $ed ); |
118 | | - if ( $modifier != '' ) { // make variant and possibly add meta data on base properties |
119 | | - if ( $subject->getNamespace() == SMW_NS_PROPERTY ) { |
120 | | - $ed = new SMWExpData( new SMWExpLiteral( $modifier, null, 'http://www.w3.org/2001/XMLSchema#string' ) ); |
121 | | - $result->addPropertyObjectValue( SMWExporter::getSpecialElement( 'swivt', 'modifier' ), $ed ); |
122 | | - $result->addPropertyObjectValue( SMWExporter::getSpecialElement( 'swivt', 'baseProperty' ), new SMWExpData( $result->getSubject() ) ); |
123 | | - } |
124 | | - $result->setSubject( $result->getSubject()->makeVariant( $modifier ) ); |
125 | | - } |
126 | 102 | return $result; |
127 | 103 | } |
128 | 104 | |
— | — | @@ -140,12 +116,7 @@ |
141 | 117 | foreach ( $values as $dv ) { |
142 | 118 | $ed = $dv->getExportData(); |
143 | 119 | if ( $ed !== null ) { |
144 | | - if ( ( $dv instanceof SMWNumberValue ) && ( $dv->getUnit() != '' ) ) { |
145 | | - $pem = $pe->makeVariant( $dv->getUnit() ); |
146 | | - } else { |
147 | | - $pem = $pe; |
148 | | - } |
149 | | - $data->addPropertyObjectValue( $pem, $ed ); |
| 120 | + $data->addPropertyObjectValue( $pe, $ed ); |
150 | 121 | } |
151 | 122 | } |
152 | 123 | } else { // pre-defined property, only exported if known |
— | — | @@ -355,4 +326,5 @@ |
356 | 327 | return $data; |
357 | 328 | } |
358 | 329 | |
| 330 | + |
359 | 331 | } |