/** * Returns a JLabel for the relation type */ @Override public Object getElementAt(int index) { JLabel label = null; if (index > -1) { RelationType rt = relationTypes.get(index); String name = rt.getFullname(); if (name.trim().length() == 0) name = rt.getId(); label = new JLabel(name); label.setName(rt.getId()); label.setToolTipText("(" + rt.getId() + ") " + rt.getDescription().replaceAll("\\s+", " ")); } return label; }
/** * Generate metadata for Relation Type. * @param rt * Relation Type (from the Ondex API). * @return JSONObject * JSONObject containing information about the Relation Type. */ private JSONObject buildRelationType(RelationType rt) { JSONObject rtJson= new JSONObject(); rtJson.put(JSONAttributeNames.ID, rt.getId()); rtJson.put(JSONAttributeNames.FULLNAME, rt.getFullname()); rtJson.put(JSONAttributeNames.INVERSENAME, rt.getInverseName()); rtJson.put(JSONAttributeNames.ISANTISYMMETRIC, String.valueOf(rt.isAntisymmetric())); rtJson.put(JSONAttributeNames.ISREFLEXTIVE, String.valueOf(rt.isReflexive())); rtJson.put(JSONAttributeNames.ISTRANSITIVE, String.valueOf(rt.isTransitiv())); rtJson.put(JSONAttributeNames.ISSYMMETRIC, String.valueOf(rt.isSymmetric())); rtJson.put(JSONAttributeNames.DESCRIPTION, rt.getDescription()); // RelationType SpecialisationOf (optional). RelationType spec= rt.getSpecialisationOf(); if(spec != null) { rtJson.put(JSONAttributeNames.SPECIALISATIONOF, buildRelationType(spec)); } return rtJson; }
fullname.setText(relationType.getFullname()); if (relationType.getDescription() != null) description.setText(relationType.getDescription());
update = true; if ((rt.getDescription() == null || rt.getDescription().equals( "")) && (descriptionS != null && descriptionS.trim().equals(
new FileOutputStream(new File(workingDir, file)), enc); String title = relation.getOfType().getDescription(); if (title.length() == 0) { title = relation.getOfType().getFullname(); + relation.getOfType().getDescription() + ") " + " Attribute Table"); xmlw.writeEndElement(); if (PRETTY)
.getDescription(), rt.getInverseName(), rt .isAntisymmetric(), rt.isReflexive(), rt.isSymmetric(), rt.isTransitiv(), newSpec);
/** * Cast a given RelationType into a BerkeleyRelationType. * * @param old * RelationType * @return BerkeleyRelationType */ protected static BerkeleyRelationType convert(RelationType old) { BerkeleyRelationType nu = new BerkeleyRelationType(old.getSID(), old.getId(), old.getFullname(), old.getDescription(), old.getInverseName(), old.isAntisymmetric(), old.isReflexive(), old.isSymmetric(), old.isTransitiv(), old.getSpecialisationOf()); return nu; }
xmlw.writeCharacters(rt.getDescription()); xmlw.writeEndElement();
for (RelationType rt : omd.getRelationTypes()) { ObjectProperty objectProperty = model.createObjectProperty(urlPrefixMetaData + rt.getId()); objectProperty.addComment(rt.getDescription(), "en"); objectProperty.addLabel(rt.getFullname(), "en");