com.hp.hpl.jena.rdf.model.Resource.removeAll()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(138)

本文整理了Java中com.hp.hpl.jena.rdf.model.Resource.removeAll方法的一些代码示例,展示了Resource.removeAll的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Resource.removeAll方法的具体详情如下:
包路径:com.hp.hpl.jena.rdf.model.Resource
类名称:Resource
方法名:removeAll

Resource.removeAll介绍

[英]Delete all the statements with predicate p for this resource from its associated model.
[中]从关联模型中删除此资源的所有谓词为p的语句。

代码示例

代码示例来源:origin: com.googlecode.foresite-toolkit/foresite

public void removeModified()
    throws OREException
{
  res.removeAll(DCTerms.modified);
}

代码示例来源:origin: com.googlecode.foresite-toolkit/foresite

public void clearRights()
{
  res.removeAll(DC.rights);
}

代码示例来源:origin: com.googlecode.foresite-toolkit/foresite

public void removeRights()
{
  res.removeAll(DC.rights);
}

代码示例来源:origin: org.w3/ldp-testsuite

protected void modifyProperty(Model m, String resourceUri, String property) {
  Resource r = m.getResource(resourceUri);
  Property p = m.createProperty(property);
  r.removeAll(p);
  // Don't sweat the value or datatype since we expect the PUT to fail anyway.
  r.addProperty(p, "modified");
}

代码示例来源:origin: com.googlecode.foresite-toolkit/foresite

public void setAuthoritative(boolean authoritative) throws OREException
{
  if (authoritative)
  {
    Selector selector = new SimpleSelector(null, ORE.isDescribedBy, res);
    StmtIterator itr = model.listStatements(selector);
    if (itr.hasNext())
    {
      Statement statement = itr.nextStatement();
      res.addProperty(OREX.isAuthoritativeFor, statement.getSubject());
    }
  }
  else
  {
    res.removeAll(OREX.isAuthoritativeFor);
  }
}

代码示例来源:origin: epimorphics/elda

@Test
public void testSantiseRelatedLinks() {
  Resource root = dhn.rdfNode().asResource();
  root.removeAll( RDFS.label )
    .addProperty( RDFS.label, "<script></script>" );
  for (Link l: dhn.relatedLinks()) {
    assertFalse( l.title().contains( "<script>" ) );
  }
  root.removeAll( RDFS.label )
    .addProperty( RDFS.label, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis fringilla sapien sed aliquet malesuada. Duis ultricies tempus ultrices. Etiam eu risus lorem. Vestibulum id eros id tortor mollis aliquam. Ut ac viverra lacus. Cras cursus interdum ante et pulvinar. Phasellus dapibus vel quam vel finibus" );
  // note we allow 20 characters for additional annotation, such as "require to be"
  int lengthLimit = DisplayHierarchyNode.MAX_RELATED_LINK_LABEL_LENGTH + 20;
  for (Link l: dhn.relatedLinks()) {
    String titleNoTags = l.title().replaceAll( "<[^>]*>", "" );
    assertTrue( titleNoTags.length() <= lengthLimit );
  }
}

代码示例来源:origin: org.w3/ldp-testsuite

resource.removeAll(DCTerms.title);

相关文章