Index: trunk/extensions/SemanticMediaWiki/includes/export/SMW_Exporter.php |
— | — | @@ -233,7 +233,7 @@ |
234 | 234 | static public function getResourceElementForProperty( SMWDIProperty $diProperty, $helperProperty = false ) { |
235 | 235 | $diWikiPage = $diProperty->getDiWikiPage(); |
236 | 236 | if ( is_null( $diWikiPage ) ) { |
237 | | - throw new Exception( 'SMWExporter::getResourceElementForProperty() can only be used for user-defined properties.' ); |
| 237 | + throw new Exception( 'SMWExporter::getResourceElementForProperty() can only be used for non-inverse, user-defined properties.' ); |
238 | 238 | } elseif ( $helperProperty ) { |
239 | 239 | return self::getResourceElementForWikiPage( $diWikiPage, 'aux' ); |
240 | 240 | } else { |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SparqlStoreQueryEngine.php |
— | — | @@ -691,17 +691,20 @@ |
692 | 692 | if ( $diProperty->isInverse() ) { // don't check if this really makes sense |
693 | 693 | $subjectName = $objectName; |
694 | 694 | $objectName = '?' . $joinVariable; |
| 695 | + $diNonInverseProperty = new SMWDIProperty( $diProperty->getKey(), false ); |
695 | 696 | } else { |
696 | 697 | $subjectName = '?' . $joinVariable; |
| 698 | + $diNonInverseProperty = $diProperty; |
697 | 699 | } |
698 | 700 | |
699 | 701 | //*** Build the condition ***// |
700 | 702 | $typeId = $diProperty->findPropertyTypeID(); |
701 | 703 | $diType = SMWDataValueFactory::getDataItemId( $typeId ); |
| 704 | + // for types that use helper properties in encoding values, refer to this helper property: |
702 | 705 | if ( SMWExporter::hasHelperExpElement( $diType ) ) { |
703 | | - $propertyExpElement = SMWExporter::getResourceElementForProperty( $diProperty, true ); |
| 706 | + $propertyExpElement = SMWExporter::getResourceElementForProperty( $diNonInverseProperty, true ); |
704 | 707 | } else { |
705 | | - $propertyExpElement = SMWExporter::getResourceElementForProperty( $diProperty ); |
| 708 | + $propertyExpElement = SMWExporter::getResourceElementForProperty( $diNonInverseProperty ); |
706 | 709 | } |
707 | 710 | $propertyName = SMWTurtleSerializer::getTurtleNameForExpElement( $propertyExpElement ); |
708 | 711 | if ( $propertyExpElement instanceof SMWExpNsResource ) { |