, 나는 내가 필요로 무엇을 할 수있는 기능을 쓸 수 있었다 :
/**
* Given a wiki page DB key and a Semantic MediaWiki property name, get
* the value for that page.
*
* Remarks: Assumes that the property is of type "string" or "blob", and that
* there is only one value for that page/property combination.
*
* @param string $dbKey The MediaWiki DB key for the page (i.e., "Test_Page")
* @param string $propertyLabel The property label used to set the Semantic MediaWiki property
* @return string The property value, or NULL if none exists
*/
static function getSemanticProperty($dbKey, $propertyLabel) {
// Use Semantic MediaWiki code to properly retrieve the value
$page = SMWDIWikiPage::newFromTitle(Title::newFromDBkey($dbKey));
$store = \SMW\StoreFactory::getStore();
$data = $store->getSemanticData($page);
$property = SMWDIProperty::newFromUserLabel($propertyLabel);
$values = $data->getPropertyValues($property);
if (count($values) > 0) {
$value = array_shift($values);
if ($value->getDIType() == SMWDataItem::TYPE_STRING ||
$value->getDIType() == SMWDataItem::TYPE_BLOB) {
return $value->getString();
}
} else {
return null;
}
}
감사에서 참조 -이 내가 찾던 것입니다. –