org.apache.jena.vocabulary.XSD类的使用及代码示例

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

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

XSD介绍

[英]Defines Jena resources corresponding to the URIs for the XSD primitive datatypes which are known to Jena.
[中]定义与Jena已知的XSD基本数据类型的URI相对应的Jena资源。

代码示例

代码示例来源: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: vivo-project/Vitro

addPrefixIfNecessary("swrl", "http://www.w3.org/2003/11/swrl#", prefixMap);
addPrefixIfNecessary("swrlb", "http://www.w3.org/2003/11/swrlb#", prefixMap);
addPrefixIfNecessary("xsd", XSD.getURI(), prefixMap);
addPrefixIfNecessary("vitro", VitroVocabulary.vitroURI, prefixMap);

代码示例来源: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

ontology.createResource().addProperty(ontology.createProperty(XSD.getURI() + "maxInclusive"), facets.maxInclusive, XSDUtil.getXSDDatatype(name))
);
    ontology.createResource().addProperty(ontology.createProperty(XSD.getURI() + "minInclusive"), facets.minInclusive, XSDUtil.getXSDDatatype(name))
);
    ontology.createResource().addProperty(ontology.createProperty(XSD.getURI() + "maxExclusive"), facets.maxExclusive, XSDUtil.getXSDDatatype(name))
);
    ontology.createResource().addProperty(ontology.createProperty(XSD.getURI() + "minExclusive"), facets.minExclusive, XSDUtil.getXSDDatatype(name))
);
    ontology.createResource().addProperty(ontology.createProperty(XSD.getURI() + "length"), facets.length, XSDUtil.getXSDDatatype(name))
);
    ontology.createResource().addProperty(ontology.createProperty(XSD.getURI() + "maxLength"), facets.maxLength, XSDUtil.getXSDDatatype(name))
);
    ontology.createResource().addProperty(ontology.createProperty(XSD.getURI() + "minLength"), facets.minLength, XSDUtil.getXSDDatatype(name))
);
    ontology.createResource().addProperty(ontology.createProperty(XSD.getURI() + "pattern"), facets.pattern, XSDDatatype.XSDstring)
);
    ontology.createResource().addProperty(ontology.createProperty(XSD.getURI() + "totalDigits"), facets.totalDigits, XSDUtil.getXSDDatatype(name))
);
    ontology.createResource().addProperty(ontology.createProperty(XSD.getURI() + "fractionDigits"), facets.fractionDigits, XSDUtil.getXSDDatatype(name))
);

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

if (NS.equals(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:position1 ex:hasOrgName \"org xyz\" . ";
"@prefix xsd: <" + XSD.getURI() + "> . \n " +
" ex:orgP ex:positionInOrganization ex:position1 . ";

相关文章

XSD类方法