/** * @deprecated since 4.0. Use {@link #object(Model)} instead. */ @Deprecated public static Value anyObject(Model m) { return object(m).orElse(null); }
/** * @deprecated since 4.0. Use {@link #object(Model)} instead. */ @Deprecated public static Value anyObject(Model m) { return object(m).orElse(null); }
/** * Retrieve a property value 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 from the given model, or {@link Optional#empty()} if no such value exists. */ public static Optional<Value> getProperty(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 object(m.filter(subject, property, null, contexts)); }
/** * Retrieve a property value 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 from the given model, or {@link Optional#empty()} if no such value exists. */ public static Optional<Value> getProperty(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 object(m.filter(subject, property, null, contexts)); }