public Set<Component> getComponentsFromModel(Model model) { ComponentReader cr = ComponentReader.create(); // get all instances of SHACL.ConstraintComponent and return then as Component instances return model.listResourcesWithProperty(RDF.type, SHACL.ConstraintComponent) .toSet().stream() .distinct() .map(cr::read) .collect(Collectors.toSet()); }
public Set<Component> getComponentsFromModel(Model model) { ComponentReader cr = ComponentReader.create(); // get all instances of SHACL.ConstraintComponent and return then as Component instances return model.listResourcesWithProperty(RDF.type, SHACL.ConstraintComponent) .toSet().stream() .distinct() .map(cr::read) .collect(Collectors.toSet()); }
private void addShapesAsSubjectsOf(Model model, ImmutableSet.Builder<Resource> shapes) { shapesAsSubjectsOf.forEach(r -> model.listSubjectsWithProperty(r).toSet().stream() .filter(RDFNode::isResource) .map(RDFNode::asResource) .forEach(shapes::add)); }
private void addShapesAsSubjectsOf(Model model, ImmutableSet.Builder<Resource> shapes) { shapesAsSubjectsOf.forEach(r -> model.listSubjectsWithProperty(r).toSet().stream() .filter(RDFNode::isResource) .map(RDFNode::asResource) .forEach(shapes::add)); }
/** Answer a Set of the objects in the full expansion of the assembler specification <code>model</code> which have rdf:type <code>type</code>, which <i>must</i> be a subtype of <code>ja:Object</code>. */ public static Set<Resource> findAssemblerRoots( Model model, Resource type ) { return fullModel( model ).listResourcesWithProperty( RDF.type, type ).toSet(); }
/** Answer a Set of the objects in the full expansion of the assembler specification <code>model</code> which have rdf:type <code>type</code>, which <i>must</i> be a subtype of <code>ja:Object</code>. */ public static Set<Resource> findAssemblerRoots( Model model, Resource type ) { return fullModel( model ).listResourcesWithProperty( RDF.type, type ).toSet(); }
public static void enrichWithSource(Model model, Node g, SparqlServiceReference ssr) { model.write(System.out, "TTL"); Set<Resource> rs = model.listSubjectsWithProperty(RDF.type, CS.ChangeSet).toSet(); // TODO Auto-generated method stub }
metricsSet.addAll(luzzuInternalModel.listResourcesWithProperty(DAQ.expectedDataType, XSD.integer.asNode()).toSet()); metricsSet.addAll(luzzuInternalModel.listResourcesWithProperty(DAQ.expectedDataType, XSD.xlong.asNode()).toSet()); metricsSet.addAll(luzzuInternalModel.listResourcesWithProperty(DAQ.expectedDataType, XSD.dateTime.asNode()).toSet()); metricsSet.addAll(luzzuInternalModel.listResourcesWithProperty(DAQ.expectedDataType, XSD.date.asNode()).toSet());
tmp = model.listObjectsOfProperty(start.asResource(), property).toSet(); } else if(start.isResource()) { tmp = new HashSet<RDFNode>(model.listSubjectsWithProperty(property, start).toSet()); } else { tmp = Collections.<RDFNode>emptySet();
public void testListSubjectsWorksAfterRemoveProperties() { final Model m = ModelHelper.modelWithStatements(this, "p1 before terminal; p2 before terminal"); m.createResource("eh:/p1").removeProperties(); ModelHelper.assertIsoModels( ModelHelper.modelWithStatements(this, "p2 before terminal"), m); Assert.assertEquals(ModelHelper.resourceSet("p2"), m.listSubjects() .toSet()); }
public void testListSubjectsWorksAfterRemoveProperties() { final Model m = ModelHelper.modelWithStatements(this, "p1 before terminal; p2 before terminal"); m.createResource("eh:/p1").removeProperties(); ModelHelper.assertIsoModels( ModelHelper.modelWithStatements(this, "p2 before terminal"), m); Assert.assertEquals(ModelHelper.resourceSet("p2"), m.listSubjects() .toSet()); }
public void testListSubjectsWorksAfterRemovePropertiesWIthLots() { final Model m = ModelHelper.modelWithStatements(this, "p2 before terminal"); for (int i = 0; i < 100; i += 1) { ModelHelper.modelAdd(m, "p1 hasValue " + i); } m.createResource("eh:/p1").removeProperties(); ModelHelper.assertIsoModels( ModelHelper.modelWithStatements(this, "p2 before terminal"), m); Assert.assertEquals(ModelHelper.resourceSet("p2"), m.listSubjects() .toSet()); } }
public void testListSubjectsWorksAfterRemovePropertiesWIthLots() { final Model m = ModelHelper.modelWithStatements(this, "p2 before terminal"); for (int i = 0; i < 100; i += 1) { ModelHelper.modelAdd(m, "p1 hasValue " + i); } m.createResource("eh:/p1").removeProperties(); ModelHelper.assertIsoModels( ModelHelper.modelWithStatements(this, "p2 before terminal"), m); Assert.assertEquals(ModelHelper.resourceSet("p2"), m.listSubjects() .toSet()); } }
Collection<Resource> s = dataModel.listSubjectsWithProperty(RDF.type, CV.DataItem).toSet();