/** * {@inheritDoc} */ @Override public ResIterator listSubjectsWithProperty(Property p) { return super.object.listSubjectsWithProperty(p); }
/** * {@inheritDoc} */ @Override public ResIterator listSubjectsWithProperty(Property p, RDFNode o) { return super.object.listSubjectsWithProperty(p, o); }
/** * {@inheritDoc} */ @Override public ResIterator listSubjectsWithProperty(Property p, String o, String l) { return super.object.listSubjectsWithProperty(p, o, l); }
/** * {@inheritDoc} */ @Override public ResIterator listSubjectsWithProperty(Property p, String o) { return super.object.listSubjectsWithProperty(p, o); }
public ResIterator listSubjectsWithProperty(Property p, RDFNode o) { return model.listSubjectsWithProperty(p, o); }
public ResIterator listSubjectsWithProperty(Property p, String o, String l) { return model.listSubjectsWithProperty(p, o, l); }
public ResIterator listSubjectsWithProperty(Property p) { return model.listSubjectsWithProperty(p); }
public ResIterator listSubjectsWithProperty(Property p, String o) { return model.listSubjectsWithProperty(p, o); }
/** * Returns the URI for a quality problem instance * * @param problemReport - A Problem Report Model * * @return The resource URI */ public List<Resource> getProblemURI(Model problemReport){ return problemReport.listSubjectsWithProperty(RDF.type, QPRO.QualityProblem).toList(); }
private static String guessNamespace(Model temp) { List<Resource> res = temp.listSubjectsWithProperty(RDF.type, OWL.Ontology).toList(); Map<String, Integer> tempMap = new HashMap<String, Integer>(); for (Resource r : res) { String ns = r.getNameSpace(); tempMap.put(ns, (tempMap.containsKey(ns)) ? (tempMap.get(ns) + 1) : 1); } if (tempMap.size() > 0) return (String) sortByValue(tempMap).keySet().toArray()[0]; else return null; }
/** Scan the given vocabulary file to find shortname and property type annotations. Ignore any URIs in <code>notThese</code>. Update notThese with any new URIs once we're done. */ public void loadVocabularyAnnotations( Set<String> notThese, Model m, PrefixMapping prefixes) { allPrefixes.withDefaultMappings( prefixes ); Set<String> seen = new HashSet<String>(); for(Resource r : RES_TYPES_TO_SHORTEN) loadAnnotations(notThese, seen, m.listSubjectsWithProperty(RDF.type, r), false, prefixes); for(Resource r : PROP_TYPES_TO_SHORTEN) loadAnnotations(notThese, seen, m.listSubjectsWithProperty(RDF.type, r), true, prefixes); loadAnnotations(notThese, seen, m.listSubjectsWithProperty(API.label), false, prefixes); loadAnnotations(notThese, seen, m.listSubjectsWithProperty(RDFS.range), true, prefixes); notThese.addAll( seen ); }
/** * Checks if a category uri exists in the metadata * * @param categoryType - The URI of the Category Type * @return The URI if exists or null */ private Resource categoryExists(Resource categoryType){ ResIterator resIte = this.metadata.listSubjectsWithProperty(RDF.type, categoryType); if (resIte.hasNext()){ return resIte.next(); } return null; }
/** * Checks if a dimension uri exists in the metadata * * @param dimensionType - The URI of the Dimension Type * @return The URI if exists or null */ private Resource dimensionExists(Resource dimensionType){ ResIterator resIte = this.metadata.listSubjectsWithProperty(RDF.type, dimensionType); if (resIte.hasNext()){ return resIte.next(); } return null; }
/** * Checks if a metric uri exists in the metadata * * @param metricType - The URI of the Metric Type * @return The URI if exists or null */ private Resource metricExists(Resource metricType){ ResIterator resIte = this.metadata.listSubjectsWithProperty(RDF.type, metricType); if (resIte.hasNext()){ return resIte.next(); } return null; } }
static Set<Resource> subjects(Model model,Property p, RDFNode r) { Set<Resource> subjects = new HashSet<>(); ResIterator it = model.listSubjectsWithProperty(p, r); while(it.hasNext()) subjects.add(it.next().asResource()); it.close(); return subjects; }
private Resource getTargetResource(final Model model) throws MessageConversionException { final ResIterator iterator= model. listSubjectsWithProperty( model.createProperty(RDF.TYPE), model.createResource(messageType())); final List<Resource> resources = Lists.newArrayList(iterator); if(resources.isEmpty()) { throw new NoDefinitionFoundException(messageType()); } else if(resources.size()>1) { throw new TooManyDefinitionsFoundException(messageType(),resources.size()); } return resources.get(0); }
private boolean isMultiplyReferencedbNode(Resource r) { ResIterator ri = model.listSubjectsWithProperty(null, r); boolean multiRef = false; if (ri.hasNext()) { ri.next(); multiRef = ri.hasNext(); } ri.close(); return multiRef; } }
/** @return The RDF resource which is the root of statements about this page's metadata */ public RDFNodeWrapper pageRoot() { ResIterator i = getModel().listSubjectsWithProperty( RDF.type, API.Page ); if (!i.hasNext()) { throw new EldaException( "Unexpected: page metadata has no resource with rdf:type api:Page" ); } RDFNodeWrapper pageRoot = new RDFNodeWrapper( this, i.next() ); if (i.hasNext()) { log.warn("unexpected: page metadata has more than one rdf:type api:Page resource - {}", i.next()); } return pageRoot; }
private void extractDatatypes( Model m ) { List<Resource> dataTypes = m.listStatements( null, RDF.type, RDFS.Datatype ).mapWith( Statement.Util.getSubject ).toList(); for (Resource t: dataTypes) declareDatatype( t.getURI() ); for (Resource p: m.listSubjectsWithProperty( RDF.type, OWL.DatatypeProperty ).toList()) { for (RDFNode t: m.listObjectsOfProperty( p, RDFS.range ).toList()) { declareDatatype( t.asResource().getURI() ); } } }
public APITester( Model model, ModelLoader loader ) { for (ResIterator ri = model.listSubjectsWithProperty(RDF.type, API.API); ri.hasNext();) { Resource api = ri.next(); APISpec spec = new APISpec( EldaFileManager.get(), api, loader ); specifications.put(api.getLocalName(), spec); for (APIEndpointSpec eps : spec.getEndpoints()) { APIEndpoint ep = APIFactory.makeApiEndpoint(eps); register(ep.getURITemplate(), ep); } } }