/** * Return the current view, if we can determine what it is. If we can't tell * from the given metadata, return the basic view. * * @return The currently selected view */ public EldaView currentView() { String viewName = varBindingsMap().get( ELDA_API.viewName.getLocalName() ); if (viewName == null) { viewName = DEFAULT_VIEW_NAME; } return findViewByName( viewName ); }
private static Resource propertyShortname(Property p) { return p .addProperty(RDF.type, RDF.Property) .addProperty(RDFS.label, p.getLocalName() ) ; }
protected void writePredicate(Statement stmt, final PrintWriter writer) { final Property predicate = stmt.getPredicate(); final RDFNode object = stmt.getObject(); writer.print(space+space+ "<" + startElementTag( predicate.getNameSpace(), predicate.getLocalName())); if (object instanceof Resource) { writer.print(" "); writeResourceReference(((Resource) object), writer); writer.println("/>"); } else { writeLiteral((Literal) object, writer); writer.println( "</" + endElementTag( predicate.getNameSpace(), predicate.getLocalName()) + ">"); } }
private void parseStudyInfo(Map<String, String> properties, Statement observedInStudy) throws StudyImporterException { StmtIterator studyProperties = observedInStudy.getObject().asResource().listProperties(); while (studyProperties.hasNext()) { Statement studyProperty = studyProperties.next(); String localName = studyProperty.getPredicate().getLocalName(); if ("locality".equals(localName)) { parseLocalityInfo(properties, getTrimmedObject(studyProperty)); } else if (OF_HABITAT.equals(localName)) { properties.put(localName, getTrimmedObject(studyProperty)); } else if ("titleAndAuthors".equals(localName)) { parseTitlesAndAuthors(getTrimmedObject(studyProperty), properties); } } }
@Override public ContextPropertyInfo findProperty(Property p) { return new ContextPropertyInfo(p.getURI(), p.getLocalName()); }
.put("pl", evidence.getModel().getPredicate().getLocalName()) .put("ol", evidence.getModel().getObject().getLabels().iterator().next())
while (stmtIterator.hasNext()) { Statement statement = stmtIterator.next(); String ln = statement.getPredicate().getLocalName(); if (PREDATOR_NAME.equals(ln)) { properties.put(ln, getTrimmedObject(statement));
/** * A workaround to obtain the label for the onProperty field for a {@link Restriction}. Ideally, this should be done * by using the {@link Restriction#onProperty(Property)}, however for ORDO, the stored node cannot be converted into * an OntProperty class. * * @param restriction the restriction being examined * @return the onProperty label as a string */ private String getOnPropertyFromRestriction(@Nonnull final Restriction restriction) { final ExtendedIterator<Statement> statements = restriction.listProperties(); while (statements.hasNext()) { final Statement statement = statements.next(); // Workaround for getting the property label. if (ON_PROPERTY_LABEL.equals(statement.getPredicate().getLocalName())) { final String onPropertyLink = statement.getObject().toString(); return restriction.getOntModel().getOntResource(onPropertyLink).getLabel(null); } } statements.close(); return null; }
/** * A workaround to obtain the label for the onProperty field for a {@link Restriction}. Ideally, this should be done * by using the {@link Restriction#onProperty(Property)}, however for Orphanet, the stored node cannot be converted * into an OntProperty class. * * @param restriction the restriction being examined * @return the onProperty label as a string */ private String getOnPropertyFromRestriction(@Nonnull final Restriction restriction) { final ExtendedIterator<Statement> statements = restriction.listProperties(); while (statements.hasNext()) { final Statement statement = statements.next(); // Workaround for getting the property label. if (ON_PROPERTY_LABEL.equals(statement.getPredicate().getLocalName())) { final String onPropertyLink = statement.getObject().toString(); return restriction.getOntModel().getOntResource(onPropertyLink).getLabel(null); } } statements.close(); return null; }
private <K,V> Map<K,V> parseIntoMap(Resource r, Map<K,V> m, ClassMeta<K> keyType, ClassMeta<V> valueType, BeanPropertyMeta pMeta) throws Exception { // Add URI as "uri" to generic maps. if (r.getURI() != null) { K uri = convertAttrToType(m, "uri", keyType); V value = convertAttrToType(m, r.getURI(), valueType); m.put(uri, value); } for (StmtIterator i = r.listProperties(); i.hasNext();) { Statement st = i.next(); Property p = st.getPredicate(); String key = p.getLocalName(); if (! (key.equals("root") && p.getURI().equals(getJuneauNs().getUri()))) { key = decodeString(key); RDFNode o = st.getObject(); K key2 = convertAttrToType(m, key, keyType); V value = parseAnything(valueType, o, m, pMeta); setName(valueType, value, key); m.put(key2, value); } } return m; }
String relation = property.getLocalName();
} else if (predicate.getLocalName().equals("comment") && predicate.getNameSpace().equals( "http://www.w3.org/1999/02/22-rdf-syntax-ns#"))
public OntModel buildGroupOntologyModel(OntModel ontModel) { OntClass groupClass = ontModel.createClass(ISOTHES.CONCEPT_GROUP .getURI()); groupClass.addLabel(ontModel.createLiteral(ISOTHES.CONCEPT_GROUP .getLocalName())); groupClass.addSuperClass(SKOS.COLLECTION); ObjectProperty subGroup = ontModel .createObjectProperty(ISOTHES.SUB_GROUP.getURI()); subGroup.addLabel(ontModel.createLiteral(ISOTHES.SUB_GROUP .getLocalName())); subGroup.addRange(groupClass); subGroup.addDomain(groupClass); ObjectProperty superGroup = ontModel .createObjectProperty(ISOTHES.SUPER_GROUP.getURI()); superGroup.addLabel(ontModel.createLiteral(ISOTHES.SUPER_GROUP .getLocalName())); superGroup.addRange(groupClass.asResource()); superGroup.addDomain(groupClass.asResource()); return ontModel; }
Predicate pred = new Predicate(); pred.setNamespace(property.getNameSpace()); pred.setName(property.getLocalName()); pred.setURI(new URI(property.getURI()));
if (verbose) log.info("Found in last time log " + prop.getLocalName() + " " + node.toString()); lastRunStatistics.put(prop.getLocalName(), node.toString());
Statement st = i.next(); Property p = st.getPredicate(); String key = decodeString(p.getLocalName()); BeanPropertyMeta pMeta = m.getPropertyMeta(key); setCurrentProperty(pMeta);
addUnsupportedFeature( "Invalid value for " + OWL2.hasSelf.getLocalName() + " restriction. Expecting \"true\"^^xsd:boolean but found: " + filler );