Class OntologyBundleExtension

java.lang.Object
com.bbn.parliament.ontology_bundle.OntologyBundleExtension

public class OntologyBundleExtension extends Object
Configuration parameters for the Ontology Bundle plugin.
  • Constructor Summary

    Constructors
    Constructor
    Description
    OntologyBundleExtension(org.gradle.api.Project project, org.gradle.api.model.ObjectFactory objFact)
    Initializes an Ontology Bundle extension object and sets conventions.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.gradle.api.file.DirectoryProperty
    The project's build directory
    org.gradle.api.provider.Property<String>
    The Java package name used for the generated Java code.
    org.gradle.api.provider.Provider<File>
    A read-only property specifying the directory for generated Java code.
    org.gradle.api.provider.Provider<File>
    A read-only property specifying the directory for generated Java resources.
    org.gradle.api.provider.Provider<File>
    A read-only property specifying the directory for generated Java test code.
    org.gradle.api.provider.Provider<String>
    A read-only property specifying the complete Gradle dependency specification for the Jena libraries that the generated jar will depend upon.
    org.gradle.api.provider.Property<String>
    The version of the Jena libraries that the generated jar will depend upon.
    org.gradle.api.provider.Provider<File>
    A read-only property specifying the path name of the human-readable ontology file.
    org.gradle.api.provider.Property<String>
    The file name used for the merged, human-readable ontology file.
    org.gradle.api.provider.Provider<File>
    A read-only property specifying the path name of the machine-readable ontology file.
    org.gradle.api.provider.Property<String>
    The file name used for the merged, machine-readable ontology file.
    org.gradle.api.provider.Property<String>
    The IRI used to identify the bundled ontology as a whole.
    org.gradle.api.file.ConfigurableFileCollection
    The set of RDF files containing the ontology to be bundled.
    org.gradle.api.provider.ListProperty<String>
    The list of RDF prefixes to use for the merged ontology.
    The project version set in the project that is using this plugin.
    org.gradle.api.file.DirectoryProperty
    The directory into which Ontology Bundle will generate reports.
    org.gradle.api.file.RegularFileProperty
    If the configuration parameters in this class do not provide enough control over SchemaGen's generation of the namespace classes, then you may provide your own SchemaGen configuration file.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • OntologyBundleExtension

      @Inject public OntologyBundleExtension(org.gradle.api.Project project, org.gradle.api.model.ObjectFactory objFact)
      Initializes an Ontology Bundle extension object and sets conventions.
      Parameters:
      project - The Gradle project, typically injected by Gradle
      objFact - The object factory, typically injected by Gradle
  • Method Details

    • getProjectVersion

      public Object getProjectVersion()
      The project version set in the project that is using this plugin.
      Returns:
      The project version. Never returns null. Default is "unspecified".
    • getBuildDir

      public org.gradle.api.file.DirectoryProperty getBuildDir()
      The project's build directory
      Returns:
      The project's build directory
    • getOntologyForHumansFileName

      public org.gradle.api.provider.Property<String> getOntologyForHumansFileName()
      The file name used for the merged, human-readable ontology file. The file extension determines the RDF serialization that will be used. The default value is "OntologyForHumans.ttl".
      Returns:
      Human-readable ontology file name
    • getOntologyForMachinesFileName

      public org.gradle.api.provider.Property<String> getOntologyForMachinesFileName()
      The file name used for the merged, machine-readable ontology file. The file extension determines the RDF serialization that will be used. The default value is "OntologyForMachines.ttl".
      Returns:
      Human-readable ontology file name
    • getPrefixes

      public org.gradle.api.provider.ListProperty<String> getPrefixes()
      The list of RDF prefixes to use for the merged ontology. A prefix must be present in this list for every namespace used in the input ontology files, although the prefix assigned here to each namespace may be different than the one that appears in the original ontology file.

      This property is a list of strings, each of the form

         prefix, class-name, namespace-iri
      
      where:
      • "prefix" is the RDF prefix that will be used in the combined ontology files.
      • "class-name" is the name given to the generated Java namespace class. If this is empty, the class will not be generated. (Note that in this case the comma must still be present.) This entry may seem redundant at first (why not just use the prefix itself?), but it gives control over the capitalization of the class name and allows for prefixes with characters that are illegal in Java identifiers.
      • "namespace-iri" is the IRI of the namespace.
      The prefixes, class names, and namespace IRIs given in this list must be unique. In other words, no prefix, class name, or namespace IRI may be repeated in this list.
      Returns:
      The list of RDF prefixes to be used in the merged ontology
    • getSchemagenConfigFile

      public org.gradle.api.file.RegularFileProperty getSchemagenConfigFile()
      If the configuration parameters in this class do not provide enough control over SchemaGen's generation of the namespace classes, then you may provide your own SchemaGen configuration file. See the documentation for Jena's SchemaGen tool for details.
      Returns:
      The path to a custom SchemaGen configuration file to use instead of Ontology Bundle's internal default.
    • getReportDir

      public org.gradle.api.file.DirectoryProperty getReportDir()
      The directory into which Ontology Bundle will generate reports. By default, this is set to build/reports/OntologyBundle relative to the project directory.
      Returns:
      The directory used for reporting
    • getOntologySources

      public org.gradle.api.file.ConfigurableFileCollection getOntologySources()
      The set of RDF files containing the ontology to be bundled. Gradle provides powerful facilities for specifying this conveniently. For instance:
         OntologyBundle {
            ...
      
            ontologySources = fileTree(dir: "$projectDir/../../../../test-ontology",
               includes: [ '&ast;&ast;/&ast;.ttl', '&ast;&ast;/&ast;.owl' ],
               exclude: '&ast;&ast;/&ast;-experimental&ast;'
            )
      
            ...
         }
      
      Returns:
      The collection of RDF files to be bundled
    • getOntologyIri

      public org.gradle.api.provider.Property<String> getOntologyIri()
      The IRI used to identify the bundled ontology as a whole. The project version, if specified, will be added to this as an owl:versionInfo attribute. If no IRI is provided, no ontology declaration will be added to the bundled ontology.
      Returns:
      The ontology IRI for the bundled ontology
    • getGeneratedCodePackageName

      public org.gradle.api.provider.Property<String> getGeneratedCodePackageName()
      The Java package name used for the generated Java code. This includes both the namespaces classes and the OntAccess class.
      Returns:
      The Java package name for the generated Java code
    • getGeneratedJavaDir

      public org.gradle.api.provider.Provider<File> getGeneratedJavaDir()
      A read-only property specifying the directory for generated Java code. This is set to build/generated/main/java.
      Returns:
      The directory for generated Java code
    • getGeneratedRsrcDir

      public org.gradle.api.provider.Provider<File> getGeneratedRsrcDir()
      A read-only property specifying the directory for generated Java resources. This is set to build/generated/main/resources.
      Returns:
      The directory for generated Java resources
    • getGeneratedTestDir

      public org.gradle.api.provider.Provider<File> getGeneratedTestDir()
      A read-only property specifying the directory for generated Java test code. This is set to build/generated/test/java.
      Returns:
      The directory for generated Java test code
    • getOntologyForHumansFile

      public org.gradle.api.provider.Provider<File> getOntologyForHumansFile()
      A read-only property specifying the path name of the human-readable ontology file. This is formed from the generatedRsrcDir and ontologyForHumansFileName properties.
      Returns:
      The path name of the human-readable ontology file
    • getOntologyForMachinesFile

      public org.gradle.api.provider.Provider<File> getOntologyForMachinesFile()
      A read-only property specifying the path name of the machine-readable ontology file. This is formed from the generatedRsrcDir and ontologyForMachinesFileName properties.
      Returns:
      The path name of the machine-readable ontology file
    • getJenaVersion

      public org.gradle.api.provider.Property<String> getJenaVersion()
      The version of the Jena libraries that the generated jar will depend upon. This is set to 4.10.0 by default.
      Returns:
      The version of the Jena libraries used
    • getJenaDependency

      public org.gradle.api.provider.Provider<String> getJenaDependency()
      A read-only property specifying the complete Gradle dependency specification for the Jena libraries that the generated jar will depend upon.
      Returns:
      The dependency specification of the Jena libraries used