Class OntologyBundleExtension
java.lang.Object
com.bbn.parliament.ontology_bundle.OntologyBundleExtension
Configuration parameters for the Ontology Bundle plugin.
-
Constructor Summary
ConstructorsConstructorDescriptionOntologyBundleExtension(org.gradle.api.Project project, org.gradle.api.model.ObjectFactory objFact) Initializes an Ontology Bundle extension object and sets conventions. -
Method Summary
Modifier and TypeMethodDescriptionorg.gradle.api.file.DirectoryPropertyThe project's build directoryorg.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.ConfigurableFileCollectionThe 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.DirectoryPropertyThe directory into which Ontology Bundle will generate reports.org.gradle.api.file.RegularFilePropertyIf 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.
-
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 GradleobjFact- The object factory, typically injected by Gradle
-
-
Method Details
-
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
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
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
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
where:prefix, class-name, namespace-iri- "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.
- 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 tobuild/reports/OntologyBundlerelative 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: [ '**/*.ttl', '**/*.owl' ], exclude: '**/*-experimental*' ) ... }- Returns:
- The collection of RDF files to be bundled
-
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
The Java package name used for the generated Java code. This includes both the namespaces classes and theOntAccessclass.- Returns:
- The Java package name for the generated Java code
-
getGeneratedJavaDir
A read-only property specifying the directory for generated Java code. This is set tobuild/generated/main/java.- Returns:
- The directory for generated Java code
-
getGeneratedRsrcDir
A read-only property specifying the directory for generated Java resources. This is set tobuild/generated/main/resources.- Returns:
- The directory for generated Java resources
-
getGeneratedTestDir
A read-only property specifying the directory for generated Java test code. This is set tobuild/generated/test/java.- Returns:
- The directory for generated Java test code
-
getOntologyForHumansFile
A read-only property specifying the path name of the human-readable ontology file. This is formed from thegeneratedRsrcDirandontologyForHumansFileNameproperties.- Returns:
- The path name of the human-readable ontology file
-
getOntologyForMachinesFile
A read-only property specifying the path name of the machine-readable ontology file. This is formed from thegeneratedRsrcDirandontologyForMachinesFileNameproperties.- Returns:
- The path name of the machine-readable ontology file
-
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
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
-