Commit fec258f0 authored by Anders Nilsson's avatar Anders Nilsson
Browse files

Fixing ClassUses

parent c65d6cc2
......@@ -220,18 +220,20 @@ aspect GenRewrites {
pStream.println(ind(1)+"}");
// TEMPORARY!!!!!
// Rewrite isSkillOf to ClassUse
// pStream.println(ind(1)+"rewrite ComplexElement {");
// pStream.println(ind(2)+"when ("+name()+")");
// pStream.println(ind(2)+"to ClassUse {");
// pStream.println(ind(3)+"ClassUse use = new ClassUse();");
// pStream.println(ind(3)+"use.setOwlIdentifier(new OwlIdentifier(\""+name()+"\"));");
// pStream.println(ind(3)+"use.setAttributeList(new List().add(new RdfResource(getAttribute(0).getValue())));");
// pStream.println(ind(3)+"use.setElementList(new List());");
// pStream.println(ind(3)+"getStart().addElement(this);");
// pStream.println(ind(3)+"return use;");
// pStream.println(ind(2)+"}");
// pStream.println(ind(1)+"}");
// Rewrite isSkillOf/hasSkill/hasProperty/isPropertyOf to ClassUse
pStream.println(ind(1)+"rewrite ComplexElement {");
pStream.println(ind(2)+"when ((name().equals(\"hasSkill\")");
pStream.println(ind(2)+"|| name().equals(\"isSkillOf\"))");
pStream.println("&& getNumAttribute() > 0 && getAttribute(0) instanceof RdfResource)");
pStream.println(ind(2)+"to ClassUse {");
pStream.println(ind(3)+"ClassUse use = new ClassUse();");
pStream.println(ind(3)+"String att = getAttribute(0).name();");
pStream.println(ind(3)+"use.setOwlIdentifier(new OwlIdentifier(att.substring(att.indexOf('#')+1,att.indexOf('_'))));");
pStream.println(ind(3)+"use.setAttributeList(getAttributeList());");
pStream.println(ind(3)+"use.setElementList(new List());");
pStream.println(ind(3)+"return use;");
pStream.println(ind(2)+"}");
pStream.println(ind(1)+"}");
super.genRewrites(pStream);
......@@ -337,6 +339,9 @@ aspect GenMisc {
pStream.println(ind(1)+"String ComplexElement.name() {");
pStream.println(ind(2)+"return getOwlIdentifier().getIDENTIFIER();");
pStream.println(ind(1)+"}");
pStream.println(ind(1)+"String Attribute.name() {");
pStream.println(ind(2)+"return getValue().getSTRING_LITERAL();");
pStream.println(ind(1)+"}");
super.genMisc(pStream);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment