public RDFDatatypeXml(DocumentBuilder documentBuilder) { this(XSD.getURI() + "xml", documentBuilder); }
public RDFDatatypeXml(DocumentBuilder documentBuilder) { this(XSD.getURI() + "xml", documentBuilder); }
/** * * @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(); }
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; }
/** 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 ); }
/** 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 ); }
RDF.getURI().equals( nsKey ) || RDFS.getURI().equals( nsKey ) || XSD.getURI().equals( nsKey ) ) )
RDF.getURI().equals( nsKey ) || RDFS.getURI().equals( nsKey ) || XSD.getURI().equals( nsKey ) ) )
/** * 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()); }
/** * 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()); }
private void checkRegistration1(String localName, Resource r) { XSDDatatype _xsd = (XSDDatatype)NodeFactory.getType(XSD.getURI() + localName) ; assertNotNull(_xsd) ; assertEquals(r.getURI(), _xsd.getURI()) ; }
private void checkRegistration1(String localName, Resource r) { XSDDatatype _xsd = (XSDDatatype)NodeFactory.getType(XSD.getURI() + localName) ; assertNotNull(_xsd) ; assertEquals(r.getURI(), _xsd.getURI()) ; }
if (baseNS.equals(XSD.getURI())) { enumClass.addSuperClass(ontology.createAllValuesFromRestriction(null, hasValue,
/** * 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()); }
/** * 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()); }
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); }
"@prefix xsd: <" + XSD.getURI() + "> . \n " + " ex:orgP ex:positionInOrganization ex:position1 . ";
q.setPrefix("owl", OWL.getURI()); if (q.getPrefix("xsd") == null) q.setPrefix("xsd", XSD.getURI());
/** * * 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#"); }
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 ; }