Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OwlCompiler
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anders Nilsson
OwlCompiler
Commits
4aff2be0
Commit
4aff2be0
authored
14 years ago
by
Anders Nilsson
Browse files
Options
Downloads
Patches
Plain Diff
Sync
parent
edda20d3
No related branches found
No related tags found
No related merge requests found
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
CompilerGeneration.jrag
+15
-0
15 additions, 0 deletions
CompilerGeneration.jrag
Names.jrag
+1
-0
1 addition, 0 deletions
Names.jrag
Types.jrag
+23
-1
23 additions, 1 deletion
Types.jrag
owl.ast
+1
-1
1 addition, 1 deletion
owl.ast
owl.jjt
+3
-2
3 additions, 2 deletions
owl.jjt
with
43 additions
and
4 deletions
CompilerGeneration.jrag
+
15
−
0
View file @
4aff2be0
...
...
@@ -46,6 +46,12 @@ aspect AbsGrammarGeneration {
pStream.println("FloatElement : SimpleElement ::=;");
pStream.println("ClassUse : Thing ::= /decl:Thing/;");
pStream.println("Attribute ::= Value;");
pStream.println("AbbreviatedIRI : Attribute ::= ;");
pStream.println("Cardinality : Attribute ::= ;");
pStream.println("DatatypeIRI : Attribute ::= ;");
pStream.println("IRI : Attribute ::= ;");
pStream.println("Name : Attribute ::= ;");
pStream.println("OntologyIRI : Attribute ::= ;");
pStream.println("RdfDatatype : Attribute ::= ;");
pStream.println("RdfId : Attribute ::= ;");
pStream.println("Xmlns : Attribute ::= ;");
...
...
@@ -92,6 +98,10 @@ aspect AbsGrammarGeneration {
}
void ClassDeclaration.genAbsGrammar(PrintStream pStream) {
if (name().equals("Thing")) {
// Thing is handled explicitly
return;
}
pStream.print(name());
pStream.print(" : "+getSuperClass().name());
pStream.print(" ::=");
...
...
@@ -121,6 +131,11 @@ aspect AbsGrammarGeneration {
pStream.print(":Thing*");
}
void DataPropertyDomain.genAbsGrammarEntry(PrintStream pStream) {
pStream.print("<"+dataProperty().name()+">");
// pStream.print(":String*");
}
void Restrictions.genAbsGrammar(PrintStream pStream) {
for (int i=0; i<getNumOwlRestriction(); i++) {
pStream.print(" ");
...
...
This diff is collapsed.
Click to expand it.
Names.jrag
+
1
−
0
View file @
4aff2be0
...
...
@@ -28,6 +28,7 @@ aspect Names {
eq Clazz.name() = iri().trim();
eq NamedIndividual.name() = iri().trim();
eq ObjectProperty.name() = iri().trim();
eq DataProperty.name() = iri().trim();
static String ASTNode.gName = "owl";
...
...
This diff is collapsed.
Click to expand it.
Types.jrag
+
23
−
1
View file @
4aff2be0
...
...
@@ -158,7 +158,7 @@ aspect Types {
// return new Properties(l);
Properties p = new Properties();
for (int i=0; i<l.getNumChild(); i++) {
O
bject
Property
Domain
op = (O
bject
Property
Domain
) l.getChild(i);
O
wl
Property op = (O
wl
Property) l.getChild(i);
if (op.domainIncludes(this)) {
p.addProperty(op);
} else {
...
...
@@ -330,6 +330,16 @@ aspect Properties {
return false;
}
boolean DataPropertyDomain.domainIncludes(Declaration clazz) {
while (!clazz.name().equals("Thing")) {
if (clazz().name().equals(clazz.name())) {
return true;
}
clazz = clazz.getSuperClass();
}
return false;
}
syn lazy RdfsRange Element.range() = null;
eq OwlObjectProperty.range() {
...
...
@@ -367,7 +377,19 @@ aspect Properties {
return null;
}
syn DataProperty DataPropertyDomain.dataProperty() {
for (Element e : getElements()) {
if (e.isDataProperty()) {
return (DataProperty) e;
}
}
System.err.println("DataPropertyDomain.dataProperty(): not found");
return null;
}
syn boolean Element.isObjectProperty() = false;
eq ObjectProperty.isObjectProperty() = true;
syn boolean Element.isDataProperty() = false;
eq DataProperty.isDataProperty() = true;
}
This diff is collapsed.
Click to expand it.
owl.ast
+
1
−
1
View file @
4aff2be0
...
...
@@ -35,7 +35,7 @@ AnnotationProperty : ComplexElement;
Clazz : ComplexElement;
ClassAssertion : ComplexElement;
DataProperty : ComplexElement;
DataPropertyDomain :
ComplexElement
;
DataPropertyDomain :
OwlProperty
;
DataPropertyRange : ComplexElement;
Datatype : ComplexElement;
Declaration : ComplexElement;
...
...
This diff is collapsed.
Click to expand it.
owl.jjt
+
3
−
2
View file @
4aff2be0
...
...
@@ -292,7 +292,8 @@ SPECIAL_TOKEN : /* COMMENTS */
"]",
".",
"&",
"@"
"@",
";"
]
>
|
...
...
@@ -325,7 +326,7 @@ SPECIAL_TOKEN : /* COMMENTS */
| < RBRACE : "}" >
// | < LBRACKET : "[" >
// | < RBRACKET : "]" >
| < SEMICOLON : ";" >
//
| < SEMICOLON : ";" >
| < QUOTE : "\"" >
// | < COMMA : "," >
// | < DOT : "." >
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment