Mercurial > hg > duomoOWLProject
diff src/de/mpiwg/dwinter/duomo/lexdump/OWLImporter.java @ 9:4392a6adf85a default tip
new version der label mit language tag
author | dwinter |
---|---|
date | Thu, 16 Aug 2012 11:40:17 +0200 |
parents | 919e9f3b5efd |
children |
line wrap: on
line diff
--- a/src/de/mpiwg/dwinter/duomo/lexdump/OWLImporter.java Thu Jun 21 17:08:22 2012 +0200 +++ b/src/de/mpiwg/dwinter/duomo/lexdump/OWLImporter.java Thu Aug 16 11:40:17 2012 +0200 @@ -171,6 +171,42 @@ * @param individual * @param propertyName * @param value + * @param lang + */ + public void setProperty(OWLIndividual individual, String propertyName, + Object value, String lang) { + RDFProperty prop = owlModel.getRDFProperty(propertyName); + individual.setPropertyValue(prop, value); + + + + //TODO: replace the following by @see{org.openrdf.rio.trig.TriGWriter} + String valName=""; + + String triple; + if (OWLIndividual.class.isInstance(value)){ + valName="<"+((OWLIndividual)value).getName()+">"; + triple = String.format("<%s> <%s> %s.\n", individual.getName(),prop.getName(),valName);} + else{ + valName=escapeRDFLit((String)value); + + + triple = String.format("<%s> <%s> \"%s\"@%s.\n", individual.getName(),prop.getName(),valName,lang); + + } + try { + outRDF.write(triple); + outRDF.flush(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + /** + * Erzeuge eine Prpoerty und schreibe die entsprechenden Informationen in das out-file. + * @param individual + * @param propertyName + * @param value */ public void setProperty(OWLIndividual individual, String propertyName, Object value) { @@ -491,6 +527,7 @@ ind = createInstance(classNameInstance); OWLIndividual identifierInd = createInstance(classNameIdentifier); setProperty(identifierInd, "rdfs:label", identifier); + setProperty(identifierInd, "rdfs:label", identifier,"en"); try { fh.write(classNameInstance+" --" +classNameIdentifier+"---"+identifier+"\n"); fh.flush();