org.apache.jena.vocabulary.XSD.getURI()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(9.3k)|赞(0)|评价(0)|浏览(107)

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

XSD.getURI介绍

[英]The RDF-friendly version of the XSD namespace with trailing # character.
[中]XSD名称空间的RDF友好版本,带有尾随#字符。

代码示例

代码示例来源:origin: org.aksw.jena-sparql-api/jena-sparql-api-sparql-ext

public RDFDatatypeXml(DocumentBuilder documentBuilder) {
  this(XSD.getURI() + "xml", documentBuilder);
}

代码示例来源:origin: SmartDataAnalytics/jena-sparql-api

public RDFDatatypeXml(DocumentBuilder documentBuilder) {
  this(XSD.getURI() + "xml", documentBuilder);
}

代码示例来源:origin: srdc/ontmalizer

/**
 * 
 * @param mainURI - mainURI for the current schema
 * @param decl
 * @return
 */
private String getURI(String mainURI, XSDeclaration decl) {
  if (decl.getTargetNamespace().equals(XSDDatatype.XSD)) {
    return XSD.getURI() + decl.getName();
  }
  return mainURI + "#" + decl.getName();
}

代码示例来源:origin: srdc/ontmalizer

private OntClass convertListOrUnion(String URI) {
  OntClass dataType = ontology.createOntResource(OntClass.class,
      RDFS.Datatype,
      URI + Constants.DATATYPE_SUFFIX);
  LOGGER.debug("datatype: {} used rdf datatyep", dataType);
  Resource anySimpleType = ontology.getResource(XSD.getURI() + "anySimpleType");
  dataType.addSuperClass(anySimpleType);
  OntClass eqDataType = ontology.createOntResource(OntClass.class,
      RDFS.Datatype,
      null);
  LOGGER.debug("equivDatatype: {} used RDFS.Datatype", eqDataType);
  eqDataType.addProperty(OWL2.onDatatype, anySimpleType);
  dataType.addEquivalentClass(eqDataType);
  return dataType;
}

代码示例来源:origin: apache/jena

/** Answer an iterator over the datatypes selected for output */
protected ExtendedIterator<? extends RDFNode> selectDatatypes() {
  List<Resource> candidates = new ArrayList<>();
  for (StmtIterator i = m_source.listStatements( null, RDF.type, RDFS.Datatype ); i.hasNext(); ) {
    Statement candidate = i.nextStatement();
    if (candidate.getObject().isResource()) {
      Resource candSubj = candidate.getSubject();
      // ignore XSD builtins
      if (!candSubj.isAnon()) {
        String candTypeURI = candSubj.getURI();
        if (candTypeURI.startsWith( XSD.getURI() )) {
          continue;
        }
      }
      // note that whether candSubj is included is tested later on by {@link #filter}
      if (!candSubj.isAnon() && !candidates.contains( candSubj )) {
        candidates.add( candSubj );
      }
    }
  }
  return sorted( candidates );
}

代码示例来源:origin: org.apache.jena/jena-cmds

/** Answer an iterator over the datatypes selected for output */
protected ExtendedIterator<? extends RDFNode> selectDatatypes() {
  List<Resource> candidates = new ArrayList<>();
  for (StmtIterator i = m_source.listStatements( null, RDF.type, RDFS.Datatype ); i.hasNext(); ) {
    Statement candidate = i.nextStatement();
    if (candidate.getObject().isResource()) {
      Resource candSubj = candidate.getSubject();
      // ignore XSD builtins
      if (!candSubj.isAnon()) {
        String candTypeURI = candSubj.getURI();
        if (candTypeURI.startsWith( XSD.getURI() )) {
          continue;
        }
      }
      // note that whether candSubj is included is tested later on by {@link #filter}
      if (!candSubj.isAnon() && !candidates.contains( candSubj )) {
        candidates.add( candSubj );
      }
    }
  }
  return sorted( candidates );
}

代码示例来源:origin: apache/jena

RDF.getURI().equals( nsKey ) ||
RDFS.getURI().equals( nsKey ) ||
XSD.getURI().equals( nsKey ) ) )

代码示例来源:origin: org.apache.jena/jena-cmds

RDF.getURI().equals( nsKey ) ||
RDFS.getURI().equals( nsKey ) ||
XSD.getURI().equals( nsKey ) ) )

代码示例来源:origin: TopQuadrant/shacl

/**
 * Sets the usual default namespaces for rdf, rdfs, owl and xsd.
 * @param prefixMapping  the Model to modify
 */
public static void initNamespaces(PrefixMapping prefixMapping) {
  ensurePrefix(prefixMapping, "rdf",  RDF.getURI());
  ensurePrefix(prefixMapping, "rdfs", RDFS.getURI());
  ensurePrefix(prefixMapping, "owl",  OWL.getURI());
  ensurePrefix(prefixMapping, "xsd",  XSD.getURI());
}

代码示例来源:origin: ch.epfl.bluebrain.nexus.org.topbraid/shacl

/**
 * Sets the usual default namespaces for rdf, rdfs, owl and xsd.
 * @param prefixMapping  the Model to modify
 */
public static void initNamespaces(PrefixMapping prefixMapping) {
  ensurePrefix(prefixMapping, "rdf",  RDF.getURI());
  ensurePrefix(prefixMapping, "rdfs", RDFS.getURI());
  ensurePrefix(prefixMapping, "owl",  OWL.getURI());
  ensurePrefix(prefixMapping, "xsd",  XSD.getURI());
}

代码示例来源:origin: apache/jena

private void checkRegistration1(String localName, Resource r) {
  XSDDatatype _xsd            = (XSDDatatype)NodeFactory.getType(XSD.getURI() + localName) ;
  assertNotNull(_xsd) ;
  assertEquals(r.getURI(), _xsd.getURI()) ;
}

代码示例来源:origin: org.apache.jena/jena-core

private void checkRegistration1(String localName, Resource r) {
  XSDDatatype _xsd            = (XSDDatatype)NodeFactory.getType(XSD.getURI() + localName) ;
  assertNotNull(_xsd) ;
  assertEquals(r.getURI(), _xsd.getURI()) ;
}

代码示例来源:origin: srdc/ontmalizer

if (baseNS.equals(XSD.getURI())) {
  enumClass.addSuperClass(ontology.createAllValuesFromRestriction(null,
      hasValue,

代码示例来源:origin: apache/jena

/**
 * Tests that SELECT result values can be marshalled to numerics OK
 * 
 * @throws SQLException
 */
@Test
public void results_select_boolean_02() throws SQLException {
  ResultSet rset = this.createResults(ds, "PREFIX xsd: <" + XSD.getURI()
      + "> SELECT ?bool { ?s ?p ?o . BIND(xsd:boolean(?o) AS ?bool) . }");
  Assert.assertNotNull(rset);
  Assert.assertFalse(rset.isClosed());
  Assert.assertTrue(rset.isBeforeFirst());
  Assert.assertFalse(rset.isLast());
  // Check all rows allow us to marshal big decimal OK
  while (rset.next()) {
    boolean b = rset.getBoolean(1);
    if (!rset.wasNull()) {
      Assert.assertTrue(b || !b);
      Assert.assertFalse(rset.wasNull());
    } else {
      Assert.assertTrue(rset.wasNull());
    }
  }
  Assert.assertTrue(rset.isAfterLast());
  rset.close();
  Assert.assertTrue(rset.isClosed());
}

代码示例来源:origin: apache/jena

/**
 * Tests that SELECT result values can be marshalled to boolean OK
 * 
 * @throws SQLException
 */
@Test
public void results_select_boolean_01() throws SQLException {
  ResultSet rset = this.createResults(ds, "PREFIX xsd: <" + XSD.getURI()
      + "> SELECT ?bool { ?s ?p ?o . BIND(xsd:boolean(?o) AS ?bool) . }");
  Assert.assertNotNull(rset);
  Assert.assertFalse(rset.isClosed());
  Assert.assertTrue(rset.isBeforeFirst());
  Assert.assertFalse(rset.isLast());
  // Check all rows allow us to marshal big decimal OK
  while (rset.next()) {
    boolean b = rset.getBoolean("bool");
    if (!rset.wasNull()) {
      Assert.assertTrue(b || !b);
      Assert.assertFalse(rset.wasNull());
    } else {
      Assert.assertTrue(rset.wasNull());
    }
  }
  Assert.assertTrue(rset.isAfterLast());
  rset.close();
  Assert.assertTrue(rset.isClosed());
}

代码示例来源:origin: SmartDataAnalytics/jena-sparql-api

public static void addDefaultPrefixMapping(PrefixMapping pm) {
  pm.setNsPrefix("rdf", RDF.getURI());
  pm.setNsPrefix("rdfs", RDFS.getURI());
  pm.setNsPrefix("owl", OWL.getURI());
  //pm.setNsPrefix("geo", "http://www.w3.org/2003/01/geo/wgs84_pos#");
  pm.setNsPrefix("geom", "http://geovocab.org/geometry#");
  pm.setNsPrefix("ogc", "http://www.opengis.net/ont/geosparql#");
  //pm.setNsPrefix("o", "http://fp7-pp.publicdata.eu/ontology/");
  pm.setNsPrefix("nominatim", "http://jsa.aksw.org/fn/nominatim/");
  pm.setNsPrefix("xsd", XSD.getURI());
  pm.setNsPrefix("json", jsonFn);
  pm.setNsPrefix("http", httpFn);
  pm.setNsPrefix("term", termFn);
  pm.setNsPrefix("tmp", tmpNs);
}

代码示例来源:origin: vivo-project/Vitro

"@prefix xsd: <" + XSD.getURI() + "> . \n " +
" ex:orgP ex:positionInOrganization ex:position1 . ";

代码示例来源:origin: Galigator/openllet

q.setPrefix("owl", OWL.getURI());
if (q.getPrefix("xsd") == null)
  q.setPrefix("xsd", XSD.getURI());

代码示例来源:origin: at.researchstudio.sat/won-core

/**
 * * Sets the default prefixes on the specified prefixMapping.
 *
 * @param prefixMapping
 */
public static void setDefaultPrefixes(PrefixMapping prefixMapping) {
  prefixMapping.setNsPrefix("won", WON.getURI());
  prefixMapping.setNsPrefix(WONMSG.DEFAULT_PREFIX, WONMSG.getURI());
  prefixMapping.setNsPrefix(WONCRYPT.DEFAULT_PREFIX, WONCRYPT.getURI());
  prefixMapping.setNsPrefix(SFSIG.DEFAULT_PREFIX, SFSIG.getURI());
  prefixMapping.setNsPrefix(CERT.DEFAULT_PREFIX, CERT.getURI());
  prefixMapping.setNsPrefix("sioc", SIOC.getURI());
  prefixMapping.setNsPrefix("rdf", RDF.getURI());
  prefixMapping.setNsPrefix("ldp", LDP.getURI());
  prefixMapping.setNsPrefix("rdfs", RDFS.getURI());
  prefixMapping.setNsPrefix("geo", GEO.getURI());
  prefixMapping.setNsPrefix("xsd", XSD.getURI());
  prefixMapping.setNsPrefix("dc", DC.getURI());
  prefixMapping.setNsPrefix("s", "http://schema.org/");
  prefixMapping.setNsPrefix("sh", "http://www.w3.org/ns/shacl#");
}

代码示例来源:origin: apache/jena

public EarlReport(String systemURI, String name, String version, String homepage)
{
  earl = ModelFactory.createDefaultModel() ;
  
  earl.setNsPrefix("earl", EARL.getURI()) ;
  earl.setNsPrefix("foaf", FOAF.getURI()) ;
  earl.setNsPrefix("rdf", RDF.getURI()) ;
  earl.setNsPrefix("dc", DC.getURI()) ;
  earl.setNsPrefix("dct", DCTerms.getURI()) ;
  earl.setNsPrefix("doap", DOAP.getURI()) ; 
  earl.setNsPrefix("xsd", XSD.getURI()) ;
  
  // Utils.
  system = (systemURI == null ) ? 
      earl.createResource(EARL.Software) :
      earl.createResource(systemURI, EARL.Software) ;
                                if ( name != null )
    system.addProperty(DC.title, name);
  if ( version != null )
    system.addProperty(DCTerms.hasVersion, version);
  if ( homepage != null )
    system.addProperty(FOAF.homepage, earl.createResource(homepage));
  
  // Can be a person or a thing.
  // But here it is automated tests unless told otherwise..
  reporter = system ;
}

相关文章

XSD类方法