Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Anders Nilsson
OwlCompiler
Commits
5016cb0f
Commit
5016cb0f
authored
Feb 14, 2006
by
Anders Nilsson
Browse files
Trying to handle functional properties of owl classes.
parent
bb7e74ca
Changes
3
Hide whitespace changes
Inline
Side-by-side
DumpClasses.jrag
View file @
5016cb0f
...
...
@@ -15,6 +15,9 @@ aspect DumpClasses {
void OwlClassDecl.dumpClasses(PrintStream pStream) {
pStream.print(getId());
pStream.println(" : "+getSuperClass().getId());
pStream.print(" : "+getSuperClass().getId());
pStream.print(" ::= ");
pStream.println(";");
}
}
\ No newline at end of file
Types.jrag
View file @
5016cb0f
...
...
@@ -36,4 +36,38 @@ aspect Types {
// that the right thing to do though.
return null;
}
syn lazy Properties OwlClassDecl.getFunctionalProperties() {
List l = new List();
getTopElement().collectFunctionalProperties(l);
Properties p = new Properties();
for (int i=0; i<l.getNumChild(); i++) {
OwlFunctionalProperty op = (OwlFunctionalProperty) l.getChild(i);
if (op.domainIncludes(this)) {
p.addElement(op);
}
}
return p;
}
}
aspect Properties {
void ASTNode.collectFunctionalProperties(List l) {
for (int i=0; i<getNumChild(); i++) {
getChild(i).collectFunctionalProperties(l);
}
}
void OwlFunctionalProperty.collectFunctionalProperties(List l) {
l.add(this);
}
boolean OwlFunctionalProperty.domainIncludes(Class clazz) {
for (int i=0; i<getNumElement(); i++) {
if (getElement(i) instanceof RdfsDomain) {
// ((RdfsDomain) getElement(i)).
}
}
return false;
}
}
\ No newline at end of file
owl.ast
View file @
5016cb0f
...
...
@@ -55,3 +55,5 @@ Value ::= <STRING_LITERAL>;
abstract Class : ComplexElement;
OwlClassDecl : Class ::= <Id:String> ;
OwlClassUse : Class ::= <Id:String> ;
Properties ::= Element*;
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment