当前位置: 首页>>代码示例>>PHP>>正文


PHP SMWQuery::setSubject方法代码示例

本文整理汇总了PHP中SMWQuery::setSubject方法的典型用法代码示例。如果您正苦于以下问题:PHP SMWQuery::setSubject方法的具体用法?PHP SMWQuery::setSubject怎么用?PHP SMWQuery::setSubject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SMWQuery的用法示例。


在下文中一共展示了SMWQuery::setSubject方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: queryProvider

 public function queryProvider()
 {
     $subject = DIWikiPage::newFromText('Foo');
     #0
     $description = new SomeProperty(new DIProperty('Foobar'), new ValueDescription(DIWikiPage::newFromText('Bar')));
     $query = new Query($description);
     $query->setSubject($subject);
     $provider[] = array($query, array(DIWikiPage::newFromText('Foo'), DIWikiPage::newFromText('Bar'), DIWikiPage::newFromText('Foobar', SMW_NS_PROPERTY)));
     #1
     $description = new SomeProperty(new DIProperty('Foobar'), new ValueDescription(new DIBlob('Bar')));
     $query = new Query($description);
     $query->setSubject($subject);
     $provider[] = array($query, array(DIWikiPage::newFromText('Foo'), DIWikiPage::newFromText('Foobar', SMW_NS_PROPERTY)));
     #2 uses inverse property declaration
     $description = new SomeProperty(new DIProperty('Foobar', true), new ValueDescription(DIWikiPage::newFromText('Bar')));
     $query = new Query($description);
     $query->setSubject($subject);
     $provider[] = array($query, array(DIWikiPage::newFromText('Foo'), DIWikiPage::newFromText('Bar'), DIWikiPage::newFromText('Foobar', SMW_NS_PROPERTY)));
     #3 Conjunction
     $description = new SomeProperty(new DIProperty('Foobar'), new ValueDescription(DIWikiPage::newFromText('Bar')));
     $query = new Query(new Conjunction(array($description, new NamespaceDescription(NS_MAIN))));
     $query->setSubject($subject);
     $provider[] = array($query, array(DIWikiPage::newFromText('Foo'), DIWikiPage::newFromText('Bar'), DIWikiPage::newFromText('Foobar', SMW_NS_PROPERTY)));
     #4 Disjunction
     $description = new SomeProperty(new DIProperty('Foobar'), new ValueDescription(DIWikiPage::newFromText('Bar')));
     $query = new Query(new Disjunction(array($description, new NamespaceDescription(NS_MAIN))));
     $query->setSubject($subject);
     $provider[] = array($query, array(DIWikiPage::newFromText('Foo'), DIWikiPage::newFromText('Bar'), DIWikiPage::newFromText('Foobar', SMW_NS_PROPERTY)));
     #5
     $description = new ClassDescription(DIWikiPage::newFromText('Foocat', NS_CATEGORY));
     $query = new Query($description);
     $query->setSubject($subject);
     $provider[] = array($query, array(DIWikiPage::newFromText('Foo'), DIWikiPage::newFromText('Foocat', NS_CATEGORY)));
     #6
     $description = new ConceptDescription(DIWikiPage::newFromText('FooConcept', SMW_NS_CONCEPT));
     $query = new Query($description);
     $query->setSubject($subject);
     $provider[] = array($query, array(DIWikiPage::newFromText('Foo'), DIWikiPage::newFromText('FooConcept', SMW_NS_CONCEPT)));
     #7 Printrequest
     $pv = \SMWPropertyValue::makeUserProperty('Foobaz');
     $description = new SomeProperty(new DIProperty('Foobar', true), new ValueDescription(DIWikiPage::newFromText('Bar')));
     $description->addPrintRequest(new PrintRequest(PrintRequest::PRINT_PROP, '', $pv));
     $query = new Query($description);
     $query->setSubject($subject);
     $provider[] = array($query, array(DIWikiPage::newFromText('Foo'), DIWikiPage::newFromText('Bar'), DIWikiPage::newFromText('Foobar', SMW_NS_PROPERTY), DIWikiPage::newFromText('Foobaz', SMW_NS_PROPERTY)));
     #8 Inverse printrequest
     $pv = \SMWPropertyValue::makeUserProperty('Foobaz');
     $pv->setInverse(true);
     $description = new SomeProperty(new DIProperty('Foobar', true), new ValueDescription(DIWikiPage::newFromText('Bar')));
     $description->addPrintRequest(new PrintRequest(PrintRequest::PRINT_PROP, '', $pv));
     $query = new Query($description);
     $query->setSubject($subject);
     $provider[] = array($query, array(DIWikiPage::newFromText('Foo'), DIWikiPage::newFromText('Bar'), DIWikiPage::newFromText('Foobar', SMW_NS_PROPERTY), DIWikiPage::newFromText('Foobaz', SMW_NS_PROPERTY)));
     return $provider;
 }
开发者ID:Rikuforever,项目名称:wiki,代码行数:55,代码来源:EmbeddedQueryDependencyListResolverTest.php

示例2: queryProvider

 public function queryProvider()
 {
     $subject = DIWikiPage::newFromText('Foo');
     #0
     $description = new SomeProperty(new DIProperty('Foobar'), new ValueDescription(DIWikiPage::newFromText('Bar')));
     $query = new Query($description);
     $query->setSubject($subject);
     $provider[] = array($query, array(DIWikiPage::newFromText('Foo'), DIWikiPage::newFromText('Bar'), DIWikiPage::newFromText('Foobar', SMW_NS_PROPERTY)));
     #1
     $description = new SomeProperty(new DIProperty('Foobar'), new ValueDescription(new DIBlob('Bar')));
     $query = new Query($description);
     $query->setSubject($subject);
     $provider[] = array($query, array(DIWikiPage::newFromText('Foo'), DIWikiPage::newFromText('Foobar', SMW_NS_PROPERTY)));
     #2 uses inverse property declaration
     $description = new SomeProperty(new DIProperty('Foobar', true), new ValueDescription(DIWikiPage::newFromText('Bar')));
     $query = new Query($description);
     $query->setSubject($subject);
     $provider[] = array($query, array(DIWikiPage::newFromText('Foo'), DIWikiPage::newFromText('Bar'), DIWikiPage::newFromText('Foobar', SMW_NS_PROPERTY)));
     #3 Conjunction
     $description = new SomeProperty(new DIProperty('Foobar'), new ValueDescription(DIWikiPage::newFromText('Bar')));
     $query = new Query(new Conjunction(array($description, new NamespaceDescription(NS_MAIN))));
     $query->setSubject($subject);
     $provider[] = array($query, array(DIWikiPage::newFromText('Foo'), DIWikiPage::newFromText('Bar'), DIWikiPage::newFromText('Foobar', SMW_NS_PROPERTY)));
     #4 Disjunction
     $description = new SomeProperty(new DIProperty('Foobar'), new ValueDescription(DIWikiPage::newFromText('Bar')));
     $query = new Query(new Disjunction(array($description, new NamespaceDescription(NS_MAIN))));
     $query->setSubject($subject);
     $provider[] = array($query, array(DIWikiPage::newFromText('Foo'), DIWikiPage::newFromText('Bar'), DIWikiPage::newFromText('Foobar', SMW_NS_PROPERTY)));
     #5
     $description = new ClassDescription(DIWikiPage::newFromText('Foocat', NS_CATEGORY));
     $query = new Query($description);
     $query->setSubject($subject);
     $provider[] = array($query, array(DIWikiPage::newFromText('Foo'), DIWikiPage::newFromText('Foocat', NS_CATEGORY)));
     #6
     $description = new ConceptDescription(DIWikiPage::newFromText('FooConcept', SMW_NS_CONCEPT));
     $query = new Query($description);
     $query->setSubject($subject);
     $provider[] = array($query, array(DIWikiPage::newFromText('Foo'), DIWikiPage::newFromText('FooConcept', SMW_NS_CONCEPT)));
     return $provider;
 }
开发者ID:kimcollin,项目名称:SemanticMediaWiki,代码行数:40,代码来源:EmbeddedQueryDependencyListResolverTest.php


注:本文中的SMWQuery::setSubject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。