if (emailResource.hasProperty(RDF.type)) { emailResource.listProperties(RDF.type).forEachRemaining(typeProperty -> email.getTypes().add(EmailType.find(typeProperty.getResource().getLocalName()))); telephoneResource.listProperties(RDF.type).forEachRemaining(typeProperty -> telephoneObject.getTypes().add( TelephoneType.find(typeProperty.getResource().getLocalName())));
/** * Given a WINGS data catalog type, this method returns the corresponding type in the export. * example of input: http://www.wings-workflows.org/wings-omics-portal/export/users/ravali/genomics/data/ontology.owl#OmicsFile * example of what should be returned: https://w3id.org/wings/[exportName]/[domain]/Data#OmicsFile * @param wingsDataClass class type to be adapted. * @return class type in the local catalog. */ public String getCatalogTypeForDataClassURI(Resource wingsDataClass){ return dataCatalogURI+wingsDataClass.getLocalName(); }
@Builder private TestGeneratorImpl(Resource element, String description, String query, Pattern pattern, Collection<ResultAnnotation> generatorAnnotations) { this.element = checkNotNull(element); String tagName = element.getLocalName(); this.description = checkNotNull(description, "Description in %s should not be null", tagName); this.query = checkNotNull(query, "Query in %s should not be null", tagName); checkState(!query.trim().isEmpty(), "Query in %s should not be empty", tagName); this.pattern = checkNotNull(pattern, "Pattern in %s should not be null", tagName); this.annotations = ImmutableList.copyOf(checkNotNull(generatorAnnotations)); }
@Builder private TestGeneratorImpl(Resource element, String description, String query, Pattern pattern, Collection<ResultAnnotation> generatorAnnotations) { this.element = checkNotNull(element); String tagName = element.getLocalName(); this.description = checkNotNull(description, "Description in %s should not be null", tagName); this.query = checkNotNull(query, "Query in %s should not be null", tagName); checkState(!query.trim().isEmpty(), "Query in %s should not be empty", tagName); this.pattern = checkNotNull(pattern, "Pattern in %s should not be null", tagName); this.annotations = ImmutableList.copyOf(checkNotNull(generatorAnnotations)); }
@Override public Object reduce( final RDFNode n, final Object acc ) { return ((String) acc) + ((Resource) n).getLocalName(); } };
@Override public Object reduce( final RDFNode n, final Object acc ) { return ((String) acc) + ((Resource) n).getLocalName(); } };
private static String rebase(Resource input, String baseIRI) { String x = input.getLocalName() ; baseIRI = baseIRI+x ; return baseIRI ; } }
private static String rebase(Resource input, String baseIRI) { String x = input.getLocalName() ; // Yuk, yuk, yuk. baseIRI = baseIRI+x ; return baseIRI ; } }
/** * Returns the name of this resource within its namespace. * * @return The name of this property within its namespace. * @throws ReadDeniedException * @throws AuthenticationRequiredException */ @Override public String getLocalName() throws ReadDeniedException, AuthenticationRequiredException { checkRead(); return holder.getBaseItem().getLocalName(); }
private void buildLocalAndNS(String URI) { if (URI == null) { this.URI = null; this.namespace = null; this.localName = null; } else { this.URI = URI; Resource uri = ResourceFactory.createResource(URI); this.namespace = uri.getNameSpace(); this.localName = uri.getLocalName(); } }
public void testGetLocalNameReturnsLocalName() { Assert.assertEquals("xyz", ModelHelper.resource("eh:xyz") .getLocalName()); }
public void testGetLocalNameReturnsLocalName() { Assert.assertEquals("xyz", ModelHelper.resource("eh:xyz") .getLocalName()); }
public static Resource addNamespace(Resource ontology, String prefix, String namespace) { Resource declaration = ontology.getModel().createResource(namespace + SH.PrefixDeclaration.getLocalName(), SH.PrefixDeclaration); ontology.addProperty(SH.declare, declaration); declaration.addProperty(SH.prefix, prefix); declaration.addProperty(SH.namespace, ResourceFactory.createTypedLiteral(namespace, XSDDatatype.XSDanyURI)); return declaration; }
private String _getName() { Statement s = testResource.getProperty(TestManifest.name) ; String ln = s.getSubject().getLocalName(); if ( s == null ) return ln+" <<unset>>" ; return "("+ln+") "+s.getString() ; }
public void testMap1() { model.read(getFileName("ontology/list5.rdf")); final RDFList root = getListRoot(model); TestList.iteratorTest(root.mapWith(n ->((Resource) n).getLocalName()), new Object[] { "a", "b", "c", "d", "e" }); }
public void testMap1() { model.read(getFileName("ontology/list5.rdf")); final RDFList root = getListRoot(model); TestList.iteratorTest(root.mapWith(n ->((Resource) n).getLocalName()), new Object[] { "a", "b", "c", "d", "e" }); }
public void testCreateAnonResourceWithNull() { final Resource r = model.createResource((String) null); Assert.assertTrue(r.isAnon()); Assert.assertNull(r.getURI()); Assert.assertNull(r.getNameSpace()); Assert.assertNull(r.getLocalName()); }
public void testCreateAnonResource() { final Resource r = model.createResource(); Assert.assertTrue(r.isAnon()); Assert.assertNull(r.getURI()); Assert.assertNull(r.getNameSpace()); Assert.assertNull(r.getLocalName()); }
public void testCreateAnonResourceWithNull() { final Resource r = model.createResource((String) null); Assert.assertTrue(r.isAnon()); Assert.assertNull(r.getURI()); Assert.assertNull(r.getNameSpace()); Assert.assertNull(r.getLocalName()); }
public void testCreateAnonResource() { final Resource r = model.createResource(); Assert.assertTrue(r.isAnon()); Assert.assertNull(r.getURI()); Assert.assertNull(r.getNameSpace()); Assert.assertNull(r.getLocalName()); }