Semantic MediaWiki and related extensions
|
Public Member Functions | |
resetCacheBy (DIWikiPage $diWikiPage) | |
makeExportData (SemanticData $semanticData) | |
makeExportDataForSubject (DIWikiPage $subject, $addStubData=false) | |
findDataItemForExpElement (ExpElement $expElement) | |
getOWLPropertyType (DIProperty $property) | |
newExpNsResourceById ( $namespaceId, $localName) | |
expandURI ( $uri) | |
decodeURI ( $uri) | |
newExpElement (SMWDataItem $dataItem) | |
newAuxiliaryExpElement (SMWDataItem $dataItem) | |
Static Public Member Functions | |
static | getInstance () |
static | clear () |
static | initBaseURIs () |
static | addPropertyValues (SMWDIProperty $property, array $dataItems, SMWExpData &$expData) |
static | getResourceElementForProperty (SMWDIProperty $diProperty, $helperProperty=false, $seekImportVocabulary=true) |
static | getResourceElementForWikiPage (DIWikiPage $diWikiPage, $markForAuxiliaryUsage=false) |
static | getSpecialPropertyResource ( $propertyKey, $forNamespace=NS_MAIN) |
static | getSpecialNsResource ( $namespaceId, $localName) |
static | getNamespaceUri ( $shortName) |
static | hasHelperExpElement (DIProperty $property) |
Public Attributes | |
const | OWL_OBJECT_PROPERTY = 'ObjectProperty' |
const | OWL_DATATYPE_PROPERTY = 'DatatypeProperty' |
const | OWL_ANNOTATION_PROPERTY = 'AnnotationProperty' |
const | POOLCACHE_ID = 'exporter.shared' |
Static Protected Member Functions | |
static | hasSpecialPropertyResource (DIProperty $property) |
Static Protected Attributes | |
static | $m_exporturl = false |
static | $m_ent_wiki = false |
static | $m_ent_property = false |
static | $m_ent_category = false |
static | $m_ent_wikiurl = false |
SMWExporter is a class for converting internal page-based data (SemanticData) into a format for easy serialisation in OWL or RDF.
|
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 SemanticData 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)
|
static |
SMWExporter::decodeURI | ( | $uri | ) |
SMWExporter::expandURI | ( | $uri | ) |
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 |
SMWExporter::findDataItemForExpElement | ( | ExpElement | $expElement | ) |
Try to find an SMWDataItem that the given ExpElement might represent. Returns null if this attempt failed.
ExpElement | $expElement |
|
static |
|
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 |
SMWExporter::getOWLPropertyType | ( | DIProperty | $property | ) |
|
static |
|
static |
|
static |
$namespaceId | string (e.g. "rdf") |
$localName | string (e.g. "type") |
|
static |
Get an ExpNsResource 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 |
|
static |
Check whether the values of a given type of dataitem have helper values in the sense of SMWExporter::getInstance()->newAuxiliaryExpElement().
DIProperty | $property |
|
static |
Make sure that necessary base URIs are initialised properly.
SMWExporter::makeExportData | ( | SemanticData | $semanticData | ) |
Create exportable data from a given semantic data record.
SemanticData | $semanticData |
SMWExporter::makeExportDataForSubject | ( | DIWikiPage | $subject, |
$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. 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 | $subject | |
$addStubData | boolean to indicate if additional data should be added to make a stub entry for this page |
SMWExporter::newAuxiliaryExpElement | ( | SMWDataItem | $dataItem | ) |
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 |
SMWExporter::newExpElement | ( | SMWDataItem | $dataItem | ) |
SMWExporter::newExpNsResourceById | ( | $namespaceId, | |
$localName | |||
) |
Create an ExpNsResource 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") |
SMWExporter::resetCacheBy | ( | DIWikiPage | $diWikiPage | ) |
const SMWExporter::OWL_ANNOTATION_PROPERTY = 'AnnotationProperty' |
These are needed in OWL DL for semantic reasons as a mechanism to attach meta-data to owl entities (classes, properties and individuals). This data is ignored by reasoners.
const SMWExporter::OWL_DATATYPE_PROPERTY = 'DatatypeProperty' |
Datatype properties link individuals to data values and is defined as an instance of the built-in OWL class owl:DatatypeProperty.
const SMWExporter::OWL_OBJECT_PROPERTY = 'ObjectProperty' |
Object properties link individuals to individuals and is defined as an instance of the built-in OWL class owl:ObjectProperty.
const SMWExporter::POOLCACHE_ID = 'exporter.shared' |
In-memory cache reference