/** * @return the uri */ public String getProjectUri() { if (this.resource != null) { if (this.resource.isURIResource()) { this.uri = this.resource.getURI(); } } return uri; } /**
public void deleteObjectProperty(Statement stmt) { Resource subject = stmt.getSubject(); if (subject.isURIResource()) { deletedObjectPropertyUris.add(subject.getURI()); } }
@Override public Property getPredicate() { Resource r = JenaUtil.getResourceProperty(this, SH.path); if(r != null && r.isURIResource()) { return JenaUtil.asProperty(r); } else { return null; } }
@Override public Property getPredicate() { Resource r = JenaUtil.getResourceProperty(this, SH.path); if(r != null && r.isURIResource()) { return JenaUtil.asProperty(r); } else { return null; } }
private static void appendNestedPath(StringBuffer sb, Resource path, String separator) { if(path.isURIResource()) { sb.append(FmtUtils.stringForNode(path.asNode(), path.getModel())); } else { sb.append("("); appendPathBlankNode(sb, path, separator); sb.append(")"); } }
private static void appendNestedPath(StringBuffer sb, Resource path, String separator) { if(path.isURIResource()) { sb.append(FmtUtils.stringForNode(path.asNode(), path.getModel())); } else { sb.append("("); appendPathBlankNode(sb, path, separator); sb.append(")"); } }
public static String algorithmResourceToString(Resource algorithmResource) throws InvalidSPDXAnalysisException { String uri = algorithmResource.getURI(); if (!algorithmResource.isURIResource()) { throw(new InvalidSPDXAnalysisException("Algorithm resource must be a URI")); } String retval = URI_TO_ALGORITHM.get(uri); if (retval == null) { throw(new InvalidSPDXAnalysisException("Invalid algorithm resource.")); } return retval; }
public static String algorithmResourceToString(Resource algorithmResource) throws InvalidSPDXAnalysisException { String uri = algorithmResource.getURI(); if (!algorithmResource.isURIResource()) { throw(new InvalidSPDXAnalysisException("Algorithm resource must be a URI")); } String retval = URI_TO_ALGORITHM.get(uri); if (retval == null) { throw(new InvalidSPDXAnalysisException("Invalid algorithm resource.")); } return retval; }
public static String fileTypeResourceToString(Resource fileTypeResource) throws InvalidSPDXAnalysisException { if (!fileTypeResource.isURIResource()) { throw(new InvalidSPDXAnalysisException("File type resource must be a URI.")); } String retval = fileTypeResource.getURI(); if (retval == null) { throw(new InvalidSPDXAnalysisException("Not a recognized file type for an SPDX document.")); } return retval; }
public static Object getJenaPath(Resource path) throws QueryParseException { if(path.isURIResource()) { return path; } else { String pathString = SHACLPaths.getPathString(path); return SHACLPaths.getJenaPath(pathString, path.getModel()); } }
public static Object getJenaPath(Resource path) throws QueryParseException { if(path.isURIResource()) { return path; } else { String pathString = SHACLPaths.getPathString(path); return SHACLPaths.getJenaPath(pathString, path.getModel()); } }
private void queueRelevantIndividuals(Statement stmt, Queue<String> individualURIs) { if(stmt.getSubject().isURIResource()) { individualURIs.add(stmt.getSubject().getURI()); } if(stmt.getObject().isURIResource() && !(RDF.type.equals(stmt.getPredicate()))) { individualURIs.add(stmt.getObject().asResource().getURI()); } }
private static Resource otherModel(Resource r, Model model) { if ( r.isURIResource() ) return model.createResource(r.getURI()) ; if ( r.isAnon() ) return model.createResource(r.getId()) ; // Literals do not need converting. return r ; }
public String getURI() { if ( testResource != null && testResource.isURIResource() ) return testResource.getURI() ; return fakeURI() ; }
@SuppressWarnings("unused") private SerialisableResource(Resource resource){ super(); this.isURI = resource.isURIResource(); this.isBlank = resource.isAnon(); this.isLiteral = resource.isLiteral(); this._resource = resource.toString(); if (this.isLiteral) literalDataType = resource.asLiteral().getDatatypeURI(); }
public DataFetcher<String> idFetcher() { return environment -> { RDFNode thisNode = environment.getSource(); if (thisNode.asResource().isURIResource()) { return thisNode.asResource().getURI(); } else { return "_:" + thisNode.asNode().getBlankNodeLabel(); } }; }
protected static void addSubclassesFrom( Model result, Model schema ) { for (StmtIterator it = schema.listStatements( ANY, RDFS.subClassOf, ANY ); it.hasNext();) { Statement s = it.nextStatement(); if (s.getSubject().isURIResource() && s.getObject().isURIResource()) result.add( s ); } }
protected static void addSubclassesFrom( Model result, Model schema ) { for (StmtIterator it = schema.listStatements( ANY, RDFS.subClassOf, ANY ); it.hasNext();) { Statement s = it.nextStatement(); if (s.getSubject().isURIResource() && s.getObject().isURIResource()) result.add( s ); } }
public void testIsURIResource() { final Model m = ModelHelper.modelWithStatements(this, ""); Assert.assertEquals(true, m.createResource("eh:/foo").isURIResource()); Assert.assertEquals(false, m.createResource().isURIResource()); Assert.assertEquals(false, m.createTypedLiteral(17).isURIResource()); Assert.assertEquals(false, m.createTypedLiteral("hello") .isURIResource()); }
public void testIsURIResource() { final Model m = ModelHelper.modelWithStatements(this, ""); Assert.assertEquals(true, m.createResource("eh:/foo").isURIResource()); Assert.assertEquals(false, m.createResource().isURIResource()); Assert.assertEquals(false, m.createTypedLiteral(17).isURIResource()); Assert.assertEquals(false, m.createTypedLiteral("hello") .isURIResource()); }