@Override public String getNameSpace() { return isAnon() ? null : node.getNameSpace(); }
private boolean isBuiltInEntity(Node n) { return n.getNameSpace().equals(RDF.getURI()) || n.getNameSpace().equals(RDFS.getURI()) || n.getNameSpace().equals(OWL.getURI()); }
@Override public String getNameSpace() { return isAnon() ? null : node.getNameSpace(); }
private boolean predicateIsTeiName(Triple triple) { return triple.getPredicate().getNameSpace().equals(TEI_NAMESPACE) && TEI_NAMES_COMPONENTS.contains(triple.getPredicate().getLocalName()); }
private static void serializeBlockStreamed(final RdfStream rdfStream, final OutputStream output, final RDFFormat format, final Map<String, String> nsPrefixes) { final Set<String> namespacesPresent = new HashSet<>(); final StreamRDF stream = new SynchonizedStreamRDFWrapper(getWriterStream(output, format)); stream.start(); // Must read the rdf stream before writing out ns prefixes, otherwise the prefixes come after the triples final List<Triple> tripleList = rdfStream.peek(t -> { // Collect the namespaces present in the RDF stream, using the same // criteria for where to look that jena's model.listNameSpaces() does namespacesPresent.add(t.getPredicate().getNameSpace()); if (RDF_TYPE.equals(t.getPredicate().getURI()) && t.getObject().isURI()) { namespacesPresent.add(t.getObject().getNameSpace()); } }).collect(Collectors.toList()); nsPrefixes.forEach((prefix, uri) -> { // Only add namespace prefixes if the namespace is present in the rdf stream if (namespacesPresent.contains(uri)) { stream.prefix(prefix, uri); } }); tripleList.forEach(stream::triple); stream.finish(); }
@Override public NodeValue exec(NodeValue v) { Node n = v.asNode() ; if ( ! n.isURI() ) throw new ExprEvalException("Not a URI: "+FmtUtils.stringForNode(n)) ; String str = n.getNameSpace() ; return NodeValue.makeString(str) ; } }
if (!edge1.getNameSpace().equals(RDF.getURI()) && !edge1.getNameSpace().equals(RDFS.getURI()) && !edge1.getNameSpace().equals(OWL.getURI())) {
String ns = null; if(node.isURI()) { ns = node.getNameSpace(); } else if(node.isLiteral()) { RDFDatatype dt = node.getLiteralDatatype();
/** test that URI nodes have namespace/localname splits which are consistent with Util.splitNamepace. */ public void testNamespace() { for ( String uri : someURIs ) { int split = Util.splitNamespaceXML( uri ); Node n = NodeCreateUtils.create( uri ); assertEquals( "check namespace", uri.substring( 0, split ), n.getNameSpace() ); assertEquals( "check localname", uri.substring( split ), n.getLocalName() ); } }
/** test that URI nodes have namespace/localname splits which are consistent with Util.splitNamepace. */ public void testNamespace() { for ( String uri : someURIs ) { int split = Util.splitNamespaceXML( uri ); Node n = NodeCreateUtils.create( uri ); assertEquals( "check namespace", uri.substring( 0, split ), n.getNameSpace() ); assertEquals( "check localname", uri.substring( split ), n.getLocalName() ); } }
@Override public void send(Quad quad) { count++ ; Node g = quad.getGraph(); Node p = quad.getPredicate(); Node ns = NodeFactory.createURI(p.getNameSpace()); increment ( properties, p ); increment ( namespaces, ns ); increment ( propertiesPerGraph, g, p ); increment ( namespacesPerGraph, g, ns ); if ( p.equals(RDF.type.asNode()) ) { Node o = quad.getObject(); if ( o.isURI() ) { ns = NodeFactory.createURI(o.getNameSpace()); increment ( classes, o ); increment ( namespaces, ns ); increment ( classesPerGraph, g, o ); increment ( namespacesPerGraph, g, ns ); } } super.send(quad) ; }
private QueryIterator subjectIsIRI(Node subject, PropFuncArg argObject, Binding binding, ExecutionContext execCxt) String namespace = subject.getNameSpace() ; String localname = subject.getLocalName() ;
final String nameSpace = o.getNameSpace(); if (nameSpace != null)
final String nameSpace = o.getNameSpace(); if (nameSpace != null)
final String nameSpace = o.getNameSpace(); if (nameSpace != null)
final String nameSpace = p.getNameSpace(); if (nameSpace != null)
final String nameSpace = p.getNameSpace(); if (nameSpace != null)
final String nameSpace = p.getNameSpace(); if (nameSpace != null)