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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anders Nilsson
OwlCompiler
Commits
ccc12a05
Commit
ccc12a05
authored
10 years ago
by
Administrator
Browse files
Options
Downloads
Patches
Plain Diff
Fixed qualified typing of generated class attributes
parent
5997cc6f
Branches
master
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CompilerGeneration.jrag
+14
-6
14 additions, 6 deletions
CompilerGeneration.jrag
Names.jrag
+1
-0
1 addition, 0 deletions
Names.jrag
Rewrites.jrag
+9
-2
9 additions, 2 deletions
Rewrites.jrag
Types.jrag
+46
-3
46 additions, 3 deletions
Types.jrag
with
70 additions
and
11 deletions
CompilerGeneration.jrag
+
14
−
6
View file @
ccc12a05
...
...
@@ -102,8 +102,8 @@ aspect AbsGrammarGeneration {
// Thing is handled explicitly
return;
}
System.out.println(name());
dumpTree(" ",System.out);
//
System.out.println(name());
//
dumpTree(" ",System.out);
pStream.print(name());
pStream.print(" : "+getSuperClass().name());
pStream.print(" ::=");
...
...
@@ -120,17 +120,25 @@ aspect AbsGrammarGeneration {
void OwlProperty.genAbsGrammarEntry(PrintStream pStream) {
pStream.print(name());
pStream.print(":Thing");
// if (allValuesFrom()) {
pStream.print("*");
pStream.print(":"+range().type()+"*");
// pStream.print(":Thing");
// // if (allValuesFrom()) {
// pStream.print("*");
// }
}
void OwlDatatypeProperty.genAbsGrammarEntry(PrintStream pStream) {
pStream.print("<"+name());
pStream.print(":String>");
// pStream.print(":"+range().type()+"*");
}
void Element.genAbsGrammarEntry(PrintStream pStream) {}
void ObjectPropertyDomain.genAbsGrammarEntry(PrintStream pStream) {
pStream.print(objectProperty().name());
pStream.print(":Thing*");
pStream.print(domain().name()+"*");
// pStream.print(":Thing*");
}
void DataPropertyDomain.genAbsGrammarEntry(PrintStream pStream) {
...
...
This diff is collapsed.
Click to expand it.
Names.jrag
+
1
−
0
View file @
ccc12a05
...
...
@@ -23,6 +23,7 @@ aspect Names {
syn String Element.name() = "";
eq OClass.name() = getId();
eq OwlProperty.name() = getId();
eq RdfsDomain.name() = getId();
eq OwlRestriction.name() = getRestrictionClassId();
eq Declaration.name() = getElement(0).name();
eq Clazz.name() = iri().trim();
...
...
This diff is collapsed.
Click to expand it.
Rewrites.jrag
+
9
−
2
View file @
ccc12a05
...
...
@@ -51,6 +51,9 @@ aspect MiscUtilities {
if (s.indexOf('#') > -1) {
s = s.substring(s.indexOf('#')+1,s.length()).trim();
}
if (s.indexOf(';') > -1) {
s = s.substring(s.indexOf(';')+1,s.length()).trim();
}
if (s.equals("string")) {
s = "String";
}
...
...
@@ -172,6 +175,11 @@ aspect MiscUtilities {
return "_Unknown_";
}
// eq RdfsDomain.getId() {
// System.out.println(((OwlClassUse) getElement(0)).getId());
// return ((OwlClassUse)getElement(0)).getId();
// }
syn lazy String Element.type() = null;
eq RdfsRange.type() {
...
...
@@ -190,7 +198,7 @@ aspect MiscUtilities {
}
// Fall through. Could not find Id, so let's return something
// well known
return "
_Unknown_
";
return "
Thing
";
}
eq OwlDataRange.type() {
...
...
@@ -231,7 +239,6 @@ aspect MiscUtilities {
}
syn boolean Declaration.isClassDecl() {
dumpTree(" ",System.out);
return getElement(0).isClass();
}
eq OwlClassDecl.isClassDecl() = true;
...
...
This diff is collapsed.
Click to expand it.
Types.jrag
+
46
−
3
View file @
ccc12a05
...
...
@@ -340,15 +340,56 @@ aspect Properties {
return false;
}
syn lazy RdfsDomain Element.domain() = null;
eq OwlObjectProperty.domain() {
for (int i=0; i<getNumElement(); i++) {
// getElement(i).dumpTree("",System.out);
// System.out.println("Checking "+getElement(i));
if (getElement(i) instanceof RdfsDomain) {
// System.out.println("Yes");
return (RdfsDomain) getElement(i);
}
}
return null;
}
eq OwlFunctionalProperty.domain() {
for (int i=0; i<getNumElement(); i++) {
if (getElement(i) instanceof RdfsDomain) {
return (RdfsDomain) getElement(i);
}
}
return null;
}
eq OwlDatatypeProperty.domain() {
for (int i=0; i<getNumElement(); i++) {
if (getElement(i) instanceof RdfsDomain) {
return (RdfsDomain) getElement(i);
}
}
return null;
}
syn lazy RdfsRange Element.range() = null;
eq OwlProperty.range() {
for (int i=0; i<getNumElement(); i++) {
if (getElement(i) instanceof RdfsRange) {
return (RdfsRange) getElement(i);
}
}
// Default to Thing
System.out.println("* Default range to Thing");
return new RdfsRange(new List().add(new RdfResource(new Value("Thing"))),new List());
}
eq OwlObjectProperty.range() {
for (int i=0; i<getNumElement(); i++) {
if (getElement(i) instanceof RdfsRange) {
return (RdfsRange) getElement(i);
}
}
return null;
// Default to Thing
return new RdfsRange(new List().add(new RdfResource(new Value("Thing"))),new List());
}
eq OwlFunctionalProperty.range() {
for (int i=0; i<getNumElement(); i++) {
...
...
@@ -356,7 +397,8 @@ aspect Properties {
return (RdfsRange) getElement(i);
}
}
return null;
// return null;
return new RdfsRange(new List().add(new RdfResource(new Value("Thing"))),new List());
}
eq OwlDatatypeProperty.range() {
for (int i=0; i<getNumElement(); i++) {
...
...
@@ -364,7 +406,8 @@ aspect Properties {
return (RdfsRange) getElement(i);
}
}
return null;
return new RdfsRange(new List().add(new RdfResource(new Value("Thing"))),new List());
// return null;
}
syn ObjectProperty ObjectPropertyDomain.objectProperty() {
...
...
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