-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Semantic handling fixes; handle observers
- Loading branch information
Ferdinando Villa
committed
Dec 1, 2024
1 parent
a4d7cb0
commit 6be8109
Showing
12 changed files
with
220 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
...src/main/java/org/integratedmodelling/klab/api/services/runtime/extension/DataExport.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package org.integratedmodelling.klab.api.services.runtime.extension; | ||
|
||
import org.integratedmodelling.klab.api.knowledge.Artifact; | ||
|
||
import java.lang.annotation.*; | ||
|
||
/** | ||
* Use over a method within a @{@link Library}-annotated class or on a class with a single public method to | ||
* provide an export method to a given media type for a given geometry, data type and/or semantics. | ||
* <p> | ||
* TODO document the argument matching for the methods. | ||
*/ | ||
@Documented | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target({ElementType.METHOD, ElementType.TYPE}) | ||
public @interface DataExport { | ||
|
||
/** | ||
* Mandatory media type to be matched with | ||
* | ||
* @return | ||
*/ | ||
String mediaType(); | ||
|
||
/** | ||
* Geometry of the observation we apply to. Should only state the main dimensions but may also provide | ||
* scale constraints. | ||
* | ||
* @return | ||
*/ | ||
String geometry(); | ||
|
||
/** | ||
* Data type to filter the applicable observations. Alternative to {@link #semantics()}, default means | ||
* anything is accepted. | ||
* | ||
* @return | ||
*/ | ||
Artifact.Type dataType() default Artifact.Type.VOID; | ||
|
||
|
||
/** | ||
* Optional semantics to filter the applicable observation. Must be a quality in the current worldview. | ||
* Should be only needed in very specific situations. | ||
* | ||
* @return | ||
*/ | ||
String semantics() default ""; | ||
} |
57 changes: 57 additions & 0 deletions
57
.../src/main/java/org/integratedmodelling/klab/api/services/runtime/extension/DataImage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package org.integratedmodelling.klab.api.services.runtime.extension; | ||
|
||
import org.integratedmodelling.klab.api.knowledge.Artifact; | ||
|
||
import java.lang.annotation.*; | ||
|
||
/** | ||
* Use on top of a method within a @{@link Library}-annotated class or on a type with a single public method | ||
* to provide an exporter of an image for a given observation. | ||
* <p> | ||
* TODO document the argument matching for the methods. | ||
*/ | ||
@Documented | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target({ElementType.METHOD, ElementType.TYPE}) | ||
public @interface DataImage { | ||
|
||
/** | ||
* Mandatory media type to be matched with | ||
* | ||
* @return | ||
*/ | ||
String mediaType(); | ||
|
||
/** | ||
* Geometry of the observation we apply to. Should only state the main dimensions but may also provide | ||
* scale constraints. | ||
* | ||
* @return | ||
*/ | ||
String geometry(); | ||
|
||
/** | ||
* Data type to filter the applicable observations. Alternative to {@link #semantics()}, default means | ||
* anything is accepted. | ||
* | ||
* @return | ||
*/ | ||
Artifact.Type dataType() default Artifact.Type.VOID; | ||
|
||
/** | ||
* If this method is particularly costly to run, provide an estimation between 0 (lowest) and 10 (highest) | ||
* so that the exporter can choose, assuming higher cost means higher quality and the cost is compounded | ||
* with the requested size of the image. | ||
* | ||
* @return | ||
*/ | ||
int cost() default 0; | ||
|
||
/** | ||
* Optional semantics to filter the applicable observation. Must be a quality in the current worldview. | ||
* Should be only needed in very specific situations. | ||
* | ||
* @return | ||
*/ | ||
String semantics() default ""; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters