Static Public Member Functions | |
| static | initBaseURIs () |
| Make sure that necessary base URIs are initialised properly. | |
| static | makeExportData (SMWSemanticData $semdata) |
| Create exportable data from a given semantic data record. | |
| static | makeExportDataForSubject (SMWDIWikiPage $diWikiPage, $typesvalueforproperty=null, $addStubData=false) |
| Make an SMWExpData object for the given page, and include the basic properties about this subject that are not directly represented by SMW property values. | |
| static | addPropertyValues (SMWDIProperty $property, array $dataItems, SMWExpData &$expData) |
| Extend a given SMWExpData element by adding export data for the specified property data itme. | |
| static | getResourceElementForProperty (SMWDIProperty $diProperty, $helperProperty=false) |
| Create an SMWExpElement for some internal resource, given by an SMWDIProperty object. | |
| static | getResourceElementForWikiPage (SMWDIWikiPage $diWikiPage, $modifier= '') |
| Create an SMWExpElement for some internal resource, given by an SMWDIWikiPage object. | |
| static | findDataItemForExpElement (SMWExpElement $expElement) |
| Try to find an SMWDataItem that the given SMWExpElement might represent. | |
| static | getOWLPropertyType ($type= '') |
| Determine what kind of OWL property some SMW property should be exported as. | |
| static | getSpecialPropertyResource ($propertyKey, $forNamespace=NS_MAIN) |
| Get an SMWExpNsResource for a special property of SMW, or null if no resource is assigned to the given property key. | |
| static | getSpecialNsResource ($namespaceId, $localName) |
| Create an SMWExpNsResource for some special element that belongs to a known vocabulary. | |
| static | encodeURI ($uri) |
| This function escapes symbols that might be problematic in XML in a uniform and injective way. | |
| static | decodeURI ($uri) |
| This function unescapes URIs generated with SMWExporter::encodeURI. | |
| static | expandURI ($uri) |
| This function expands standard XML entities used in some generated URIs. | |
| static | getNamespaceUri ($shortName) |
| Get the URI of a standard namespace prefix used in SMW, or the empty string if the prefix is not known. | |
| static | getOntologyExpData ($ontologyuri) |
| Create an SMWExpData container that encodes the ontology header for an SMW exported OWL file. | |
| static | getDataItemExpElement (SMWDataItem $dataItem) |
| Create an SWMExpElement that encodes the data of the given dataitem object. | |
| static | getDataItemHelperExpElement (SMWDataItem $dataItem) |
| Create an SWMExpElement that encodes auxiliary data for representing values of the specified dataitem object in a simplified fashion. | |
| static | hasHelperExpElement ($dataItemType) |
| Check whether the values of a given type of dataitem have helper values in the sense of SMWExporter::getDataItemHelperExpElement(). | |
Static Protected Attributes | |
| static | $m_exporturl = false |
| static | $m_ent_wiki = false |
| static | $m_ent_property = false |
| static | $m_ent_wikiurl = false |
Definition at line 14 of file SMW_Exporter.php.
| static SMWExporter::initBaseURIs | ( | ) | [static] |
Make sure that necessary base URIs are initialised properly.
Definition at line 23 of file SMW_Exporter.php.
References $wgServer.
| static SMWExporter::makeExportData | ( | SMWSemanticData $ | semdata | ) | [static] |
Create exportable data from a given semantic data record.
| $semdata | SMWSemanticData |
Definition at line 50 of file SMW_Exporter.php.
References SMWSemanticData::getPropertyValues(), and SMWSemanticData::getSubject().
Referenced by SMWSparqlStore::prepareUpdateExpData(), and SMWExportController::serializePage().
| static SMWExporter::makeExportDataForSubject | ( | SMWDIWikiPage $ | diWikiPage, | |
| $ | typesvalueforproperty = null, |
|||
| $ | addStubData = false | |||
| ) | [static] |
Make an SMWExpData object for the given page, and include the basic properties about this subject that are not directly represented by SMW property values.
The optional parameter $typevalueforproperty can be used to pass a particular SMWTypesValue object that is used for determining the OWL type for property pages.
| $diWikiPage | SMWDIWikiPage | |
| $typesvalueforproperty | mixed either an SMWTypesValue or null | |
| $addStubData | boolean to indicate if additional data should be added to make a stub entry for this page |
Definition at line 79 of file SMW_Exporter.php.
References SMWDIWikiPage::getDBkey(), SMWDIWikiPage::getSubobjectName(), and smwfGetStore().
Referenced by SMWSparqlStore::expandUpdateExpResource(), and SMWRDFResultPrinter::getResultText().
| static SMWExporter::addPropertyValues | ( | SMWDIProperty $ | property, | |
| array $ | dataItems, | |||
| SMWExpData &$ | expData | |||
| ) | [static] |
Extend a given SMWExpData element by adding export data for the specified property data itme.
This method is called when constructing export data structures from SMWSemanticData objects.
| $property | SMWDIProperty | |
| $dataItems | array of SMWDataItem objects for the given property | |
| $data | SMWExpData to add the data to |
TODO: currently no full check for avoiding OWL DL illegal redirects is done (OWL property type ignored)
Definition at line 153 of file SMW_Exporter.php.
References SMWExpData::addPropertyObjectValue(), SMWDIProperty::getKey(), SMWExpData::getSubject(), and SMWDataItem::TYPE_WIKIPAGE.
Referenced by SMWRDFResultPrinter::getResultText().
| static SMWExporter::getResourceElementForProperty | ( | SMWDIProperty $ | diProperty, | |
| $ | helperProperty = false | |||
| ) | [static] |
Create an SMWExpElement for some internal resource, given by an SMWDIProperty object.
This code is only applied to user-defined properties, since the code for special properties in SMWExporter::getSpecialPropertyResource() may require information about the namespace in which some special property is used.
| $diProperty | SMWDIProperty | |
| $helperProperty | boolean determines if an auxiliary property resource to store a helper value (see SMWExporter::getDataItemHelperExpElement()) should be generated |
Definition at line 235 of file SMW_Exporter.php.
References SMWDIProperty::getDiWikiPage().
Referenced by SMWSparqlStoreQueryEngine::buildPropertyCondition().
| static SMWExporter::getResourceElementForWikiPage | ( | SMWDIWikiPage $ | diWikiPage, | |
| $ | modifier = '' | |||
| ) | [static] |
Create an SMWExpElement for some internal resource, given by an SMWDIWikiPage object.
This is the one place in the code where URIs of wiki pages and user-defined properties are determined. A modifier can be given to make variants of a URI, typically done for auxiliary properties. In this case, the URI is modiied by appending "-23$modifier" where "-23" is the URI encoding of "#" (a symbol not occuring in MW titles).
| $diWikiPage | SMWDIWikiPage or SMWDIProperty | |
| $modifier | string, using only Latin letters and numbers |
Definition at line 259 of file SMW_Exporter.php.
References SMWDIWikiPage::getDBkey(), SMWDIWikiPage::getSubobjectName(), SMWDataValueFactory::newDataItemValue(), and smwfGetStore().
Referenced by SMWSparqlStoreQueryEngine::buildClassCondition().
| static SMWExporter::findDataItemForExpElement | ( | SMWExpElement $ | expElement | ) | [static] |
Try to find an SMWDataItem that the given SMWExpElement might represent.
Returns null if this attempt failed.
| SMWExpElement | $expElement |
Definition at line 320 of file SMW_Exporter.php.
Referenced by SMWSparqlStoreQueryEngine::getQueryResultFromSparqlResult().
| static SMWExporter::getOWLPropertyType | ( | $ | type = '' |
) | [static] |
Determine what kind of OWL property some SMW property should be exported as.
The input is an SMWTypesValue object, a typeid string, or empty (use default)
Definition at line 374 of file SMW_Exporter.php.
References SMWDataValueFactory::findTypeID().
Referenced by SMWConceptValue::descriptionToExpData().
| static SMWExporter::getSpecialPropertyResource | ( | $ | propertyKey, | |
| $ | forNamespace = NS_MAIN | |||
| ) | [static] |
Get an SMWExpNsResource for a special property of SMW, or null if no resource is assigned to the given property key.
The optional namespace is used to select the proper resource for properties that must take the type of the annotated object into account for some reason.
| $propertyKey | string the Id of the special property | |
| $forNamespace | integer the namespace of the page which has a value for this property |
Definition at line 401 of file SMW_Exporter.php.
Referenced by SMWSparqlStoreQueryEngine::addOrderByData(), SMWSparqlStoreQueryEngine::buildClassCondition(), and SMWSparqlStore::getSparqlRedirectTarget().
| static SMWExporter::getSpecialNsResource | ( | $ | namespaceId, | |
| $ | localName | |||
| ) | [static] |
Create an SMWExpNsResource for some special element that belongs to a known vocabulary.
An exception is generated when given parameters that do not fit any known vocabulary.
| $namespaceId | string (e.g. "rdf") | |
| $localName | string (e.g. "type") |
Definition at line 452 of file SMW_Exporter.php.
Referenced by SMWSparqlStoreQueryEngine::buildNamespaceCondition(), SMWSparqlStore::deleteSparqlData(), SMWConceptValue::descriptionToExpData(), SMWExpData::extractMainType(), SMWExpData::getCollection(), SMWConceptValue::getExportData(), SMWSparqlStoreQueryEngine::getSparqlConditionString(), SMWExpData::getSpecialValues(), SMWExpData::makeCollection(), SMWExportController::printPageList(), and SMWExportController::printWikiInfo().
| static SMWExporter::encodeURI | ( | $ | uri | ) | [static] |
This function escapes symbols that might be problematic in XML in a uniform and injective way.
It is used to encode URIs.
Definition at line 465 of file SMW_Exporter.php.
| static SMWExporter::decodeURI | ( | $ | uri | ) | [static] |
This function unescapes URIs generated with SMWExporter::encodeURI.
This allows services that receive a URI to extract e.g. the according wiki page.
Definition at line 478 of file SMW_Exporter.php.
Referenced by SMWURIResolver::execute().
| static SMWExporter::expandURI | ( | $ | uri | ) | [static] |
This function expands standard XML entities used in some generated URIs.
Given a string with such entities, it returns a string with all entities properly replaced.
| $uri | string of the URI to be expanded |
Definition at line 497 of file SMW_Exporter.php.
Referenced by SMWTurtleSerializer::getTurtleNameForExpElement(), SMWInfolink::getURL(), SMWExportController::printPageList(), SMWExportController::printPages(), SMWExportController::printWikiInfo(), SMWTurtleSerializer::serializeDeclaration(), SMWTurtleSerializer::serializeHeader(), and SMWRDFXMLSerializer::serializeHeader().
| static SMWExporter::getNamespaceUri | ( | $ | shortName | ) | [static] |
Get the URI of a standard namespace prefix used in SMW, or the empty string if the prefix is not known.
| $shortName | string id (prefix) of the namespace |
Definition at line 513 of file SMW_Exporter.php.
Referenced by SMWSparqlDatabase::getPrefixString(), and SMWSparqlStore::getSparqlRedirectTarget().
| static SMWExporter::getOntologyExpData | ( | $ | ontologyuri | ) | [static] |
Create an SMWExpData container that encodes the ontology header for an SMW exported OWL file.
| string | $ontologyuri specifying the URI of the ontology, possibly empty |
Definition at line 536 of file SMW_Exporter.php.
Referenced by SMWRDFResultPrinter::getResultText(), SMWExportController::printAll(), SMWExportController::printPageList(), SMWExportController::printPages(), and SMWExportController::printWikiInfo().
| static SMWExporter::getDataItemExpElement | ( | SMWDataItem $ | dataItem | ) | [static] |
Create an SWMExpElement that encodes the data of the given dataitem object.
This method is meant to be used when exporting a dataitem as a subject or object. To get the URI of a property, use SMWExporter::getResourceElementForProperty() or SMWExporter::getSpecialPropertyResource().
| $dataItem | SMWDataItem |
TODO
TODO
Definition at line 557 of file SMW_Exporter.php.
References SMWDITime::CM_GREGORIAN, SMWDITime::PREC_YM, SMWDITime::PREC_YMD, SMWDITime::PREC_YMDT, smwfHTMLtoUTF8(), SMWDataItem::TYPE_BLOB, SMWDataItem::TYPE_BOOLEAN, SMWDataItem::TYPE_CONCEPT, SMWDataItem::TYPE_CONTAINER, SMWDataItem::TYPE_GEO, SMWDataItem::TYPE_NUMBER, SMWDataItem::TYPE_PROPERTY, SMWDataItem::TYPE_STRING, SMWDataItem::TYPE_TIME, SMWDataItem::TYPE_URI, and SMWDataItem::TYPE_WIKIPAGE.
Referenced by SMWSparqlStoreQueryEngine::buildValueCondition(), SMWSparqlStore::changeTitle(), SMWSparqlStore::deleteSubject(), SMWConceptValue::descriptionToExpData(), and SMWSparqlStore::doDataUpdate().
| static SMWExporter::getDataItemHelperExpElement | ( | SMWDataItem $ | dataItem | ) | [static] |
Create an SWMExpElement that encodes auxiliary data for representing values of the specified dataitem object in a simplified fashion.
This is done for types of dataitems that are not supported very well in current systems, or that do not match a standard datatype in RDF. For example, time points (DITime) are encoded as numbers. The number can replace the actual time for all query and ordering purposes (the order in either case is linear and maps to the real number line). Only data retrieval should better use the real values to avoid that rounding errors lead to unfaithful recovery of data. Note that the helper values do not maintain any association with their original values -- they are a fully redundant alternative representation, not an additional piece of information for the main values. Even if decoding is difficult, they must be in one-to-one correspondence to the original value.
For dataitems that do not have such a simplification, the method returns null.
| $dataItem | SMWDataItem |
Definition at line 640 of file SMW_Exporter.php.
References SMWDataItem::TYPE_TIME.
Referenced by SMWSparqlStoreQueryEngine::buildValueCondition().
| static SMWExporter::hasHelperExpElement | ( | $ | dataItemType | ) | [static] |
Check whether the values of a given type of dataitem have helper values in the sense of SMWExporter::getDataItemHelperExpElement().
| $dataItemType | integer type ID of dataitem (see SMWDataItem) |
Definition at line 656 of file SMW_Exporter.php.
References SMWDataItem::TYPE_TIME.
Referenced by SMWSparqlStoreQueryEngine::buildPropertyCondition().
SMWExporter::$m_exporturl = false [static, protected] |
Definition at line 15 of file SMW_Exporter.php.
SMWExporter::$m_ent_wiki = false [static, protected] |
Definition at line 16 of file SMW_Exporter.php.
SMWExporter::$m_ent_property = false [static, protected] |
Definition at line 17 of file SMW_Exporter.php.
SMWExporter::$m_ent_wikiurl = false [static, protected] |
Definition at line 18 of file SMW_Exporter.php.
1.5.6