/** * @deprecated since 4.0. Use {@link #objectIRI(Model)} instead. */ @Deprecated public static URI anyObjectURI(Model m) { return objectIRI(m).orElse(null); }
/** * @deprecated since 4.0. Use {@link #objectIRI(Model)} instead. */ @Deprecated public static URI anyObjectURI(Model m) { return objectIRI(m).orElse(null); }
private IRI getFunctionIRI(Resource execution, Model model) { return Models.objectIRI( model.filter(execution, Rdf.Fno.executes, null) ) .orElseThrow(() -> new RuntimeException( "function execution does not have fno:executes value")); }
/** * Retrieve a property value as an IRI for the supplied subject from the given model. If more than one property value exists, * any one value is picked and returned. * * @param m * the model from which to retrieve an object value. * @param subject * the subject resource for which to retrieve a property value. * @param property * the property for which to retrieve a value. * @param contexts * the contexts from which to retrieve the property value. Optional vararg argument. If not * specified the operations works on the entire Model. * @return a property value IRI from the given model, or {@link Optional#empty()} if no such value exists. */ public static Optional<IRI> getPropertyIRI(Model m, Resource subject, IRI property, Resource... contexts) { Objects.requireNonNull(m, "model may not be null"); Objects.requireNonNull(subject, "subject may not be null"); Objects.requireNonNull(property, "property may not be null"); return objectIRI(m.filter(subject, property, null, contexts)); }
/** * Retrieve a property value as an IRI for the supplied subject from the given model. If more than one property value exists, * any one value is picked and returned. * * @param m * the model from which to retrieve an object value. * @param subject * the subject resource for which to retrieve a property value. * @param property * the property for which to retrieve a value. * @param contexts * the contexts from which to retrieve the property value. Optional vararg argument. If not * specified the operations works on the entire Model. * @return a property value IRI from the given model, or {@link Optional#empty()} if no such value exists. */ public static Optional<IRI> getPropertyIRI(Model m, Resource subject, IRI property, Resource... contexts) { Objects.requireNonNull(m, "model may not be null"); Objects.requireNonNull(subject, "subject may not be null"); Objects.requireNonNull(property, "property may not be null"); return objectIRI(m.filter(subject, property, null, contexts)); }
@Override public void parse(Model m, Resource implNode) throws RepositoryConfigException { super.parse(m, implNode); try { Models.objectIRI(m.filter(implNode, QUERY_ENDPOINT, null)).ifPresent( iri -> setQueryEndpointUrl(iri.stringValue())); Models.objectIRI(m.filter(implNode, UPDATE_ENDPOINT, null)).ifPresent( iri -> setUpdateEndpointUrl(iri.stringValue())); } catch (ModelException e) { throw new RepositoryConfigException(e.getMessage(), e); } } }
@Override public void parse(Model m, Resource implNode) throws RepositoryConfigException { super.parse(m, implNode); try { Models.objectIRI(m.filter(implNode, QUERY_ENDPOINT, null)).ifPresent( iri -> setQueryEndpointUrl(iri.stringValue())); Models.objectIRI(m.filter(implNode, UPDATE_ENDPOINT, null)).ifPresent( iri -> setUpdateEndpointUrl(iri.stringValue())); } catch (ModelException e) { throw new RepositoryConfigException(e.getMessage(), e); } } }
@Override public void parse(Model m, Resource implNode) throws RepositoryConfigException { super.parse(m, implNode); try { Models.objectIRI(m.filter(implNode, QUERY_ENDPOINT, null)).ifPresent( iri -> setQueryEndpointUrl(iri.stringValue())); Models.objectIRI(m.filter(implNode, UPDATE_ENDPOINT, null)).ifPresent( iri -> setUpdateEndpointUrl(iri.stringValue())); } catch (ModelException e) { throw new RepositoryConfigException(e.getMessage(), e); } } }
lit -> setQueryLanguage(QueryLanguage.valueOf(lit.getLabel()))); Models.objectIRI(model.filter(resource, QUERY_LANGUAGE, null)).ifPresent( iri -> setBaseURI(iri.stringValue())); setArchiveContexts(objects.toArray(new IRI[objects.size()])); Models.objectIRI(model.filter(resource, INSERT_CONTEXT, null)).ifPresent( iri -> setInsertContext(iri));
lit -> setQueryLanguage(QueryLanguage.valueOf(lit.getLabel()))); Models.objectIRI(model.filter(resource, QUERY_LANGUAGE, null)).ifPresent( iri -> setBaseURI(iri.stringValue())); setArchiveContexts(objects.toArray(new IRI[objects.size()])); Models.objectIRI(model.filter(resource, INSERT_CONTEXT, null)).ifPresent( iri -> setInsertContext(iri));
lit -> setQueryLanguage(QueryLanguage.valueOf(lit.getLabel()))); Models.objectIRI(model.filter(resource, QUERY_LANGUAGE, null)).ifPresent( iri -> setBaseURI(iri.stringValue())); setArchiveContexts(objects.toArray(new IRI[objects.size()])); Models.objectIRI(model.filter(resource, INSERT_CONTEXT, null)).ifPresent( iri -> setInsertContext(iri));
@Override public void parse(Model model, Resource implNode) throws RepositoryConfigException { super.parse(model, implNode); try { Models.objectIRI(model.filter(implNode, REPOSITORYURL, null)).ifPresent( iri -> setURL(iri.stringValue())); Models.objectLiteral(model.filter(implNode, USERNAME, null)).ifPresent( username -> setUsername(username.getLabel())); Models.objectLiteral(model.filter(implNode, PASSWORD, null)).ifPresent( password -> setPassword(password.getLabel())); } catch (ModelException e) { throw new RepositoryConfigException(e.getMessage(), e); } } }
@Override public void parse(Model model, Resource implNode) throws RepositoryConfigException { super.parse(model, implNode); try { Models.objectIRI(model.filter(implNode, REPOSITORYURL, null)).ifPresent( iri -> setURL(iri.stringValue())); Models.objectLiteral(model.filter(implNode, USERNAME, null)).ifPresent( username -> setUsername(username.getLabel())); Models.objectLiteral(model.filter(implNode, PASSWORD, null)).ifPresent( password -> setPassword(password.getLabel())); } catch (ModelException e) { throw new RepositoryConfigException(e.getMessage(), e); } } }
@Override public void parse(Model model, Resource implNode) throws RepositoryConfigException { super.parse(model, implNode); try { Models.objectIRI(model.filter(implNode, REPOSITORYURL, null)).ifPresent( iri -> setURL(iri.stringValue())); Models.objectLiteral(model.filter(implNode, USERNAME, null)).ifPresent( username -> setUsername(username.getLabel())); Models.objectLiteral(model.filter(implNode, PASSWORD, null)).ifPresent( password -> setPassword(password.getLabel())); } catch (ModelException e) { throw new RepositoryConfigException(e.getMessage(), e); } } }