Skip to content

Commit

Permalink
Linting.
Browse files Browse the repository at this point in the history
  • Loading branch information
GCHQDeveloper42 committed Apr 5, 2024
1 parent 9182397 commit bebcd16
Show file tree
Hide file tree
Showing 208 changed files with 1,297 additions and 1,699 deletions.
27 changes: 14 additions & 13 deletions checkstyle-suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@
<!DOCTYPE suppressions PUBLIC "-//Checkstyle//DTD Suppressions 1.2//EN" "https://checkstyle.org/dtds/suppressions_1_2.dtd">

<suppressions>
<!-- global suppressions -->
<suppress checks="AvoidStarImport" files="\.java" />
<!-- global suppressions -->
<suppress checks="AvoidStarImport" files="\.java" />

<!-- core suppressions -->
<suppress checks="AbbreviationAsWordInName" files="UID\.java" />
<!-- core suppressions -->
<suppress checks="AbbreviationAsWordInName" files="UID\.java" />

<!-- examples suppressions -->
<suppress checks="LineLength" files="ExampleDataObjects.java|ExampleRdl.java|ExampleAssociations.java|MagmaCoreService.java" />
<suppress checks="MethodLength" files="ExampleDataObjects.java" />
<!-- examples suppressions -->
<suppress checks="LineLength"
files="ClassServices.java|ExampleDataObjects.java|ExampleRdl.java|ExampleAssociations.java|MagmaCoreService.java" />
<suppress checks="MethodLength" files="ExampleDataObjects.java" />

<!-- hqdm-core suppressions -->
<suppress checks="MethodName" files="impl/*" />
<suppress checks="TypeName" files="Function_.java" />
<suppress checks="ConstantName" files="HQDM.java" />
<suppress checks="AbbreviationAsWordInName" files="IRI.java|HQDM.java|RDFS.java|UID.java" />
</suppressions>
<!-- hqdm-core suppressions -->
<suppress checks="MethodName" files="impl/*" />
<suppress checks="TypeName" files="Function_.java" />
<suppress checks="ConstantName" files="HQDM.java" />
<suppress checks="AbbreviationAsWordInName" files="IRI.java|HQDM.java|RDFS.java|UID.java" />
</suppressions>
12 changes: 7 additions & 5 deletions examples/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>uk.gov.gchq.magma-core</groupId>
Expand All @@ -21,16 +23,16 @@
<dependencies>
<dependency>
<groupId>uk.gov.gchq.magma-core</groupId>
<artifactId>hqdm-canonical</artifactId>
<artifactId>core</artifactId>
</dependency>
<dependency>
<groupId>uk.gov.gchq.magma-core</groupId>
<artifactId>core</artifactId>
<artifactId>hqdm-canonical</artifactId>
</dependency>
<dependency>
<groupId>uk.gov.gchq.magma-core</groupId>
<artifactId>model-extension-example</artifactId>
</dependency>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand All @@ -40,4 +42,4 @@
<artifactId>slf4j-jdk14</artifactId>
</dependency>
</dependencies>
</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import uk.gov.gchq.magmacore.service.MagmaCoreServiceFactory;

/**
* Create a KindOfOrganization and make a Thing a member_of_kind of it,
* then persist the Thing and make sure it is read back as an Organization.
* Create a KindOfOrganization and make a Thing a member_of_kind of it, then persist the Thing and
* make sure it is read back as an Organization.
*
* <p>
* This demonstrates the implementation of instances of 'kinds' as new entity types.
Expand All @@ -34,7 +34,7 @@ public class CreateOrganizationSubTypeUsingKinds {
* A Base URL for the tests.
*/
private static IriBase TEST_BASE = new IriBase("test", "http://example.com/test#");

/**
* Unit test.
*/
Expand All @@ -45,20 +45,20 @@ public void test() {

// We need a kind of organization component for the kind of organization.
final KindOfOrganizationComponent componentKind = new KindOfOrganizationComponentBuilder(randomIri())
.build();
.build();

// Create a new kind of organization to represent companies.
// This will also make the new kind into a sub-type of organization.
final KindOfOrganization companies = new KindOfOrganizationBuilder(randomIri())
.has_Component_By_Class_M(componentKind)
.build();
.has_Component_By_Class_M(componentKind)
.build();

// Create an Individual and make it a member_of_kind of the companies kind.
// This will also mean that the individual is of type organization, via its kind.
// This will also mean that the individual is of type organization, via its kind.
final Individual acmeLtd = new IndividualBuilder(randomIri())
.member_Of_Kind(companies)
.part_Of_Possible_World_M(possibleWorld)
.build();
.member_Of_Kind(companies)
.part_Of_Possible_World_M(possibleWorld)
.build();

// Persist everything.
final MagmaCoreService service = MagmaCoreServiceFactory.createWithJenaDatabase();
Expand All @@ -81,7 +81,7 @@ public void test() {
*
* @return IRI
*/
private static IRI randomIri() {
private static IRI randomIri() {
return new IRI(TEST_BASE, UUID.randomUUID().toString());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,7 @@ public final AcceptanceOfOfferBuilder part_Of_M(final AgreeContract agreeContrac
/**
* A {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#PART_OF} relationship type where a
* {@link uk.gov.gchq.magmacore.hqdm.model.SociallyConstructedObject} may be a
* {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#PART_OF} one or more
* {@link AgreementExecution}.
* {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#PART_OF} one or more {@link AgreementExecution}.
*
* @param agreementExecution The AgreementExecution.
* @return This builder.
Expand All @@ -260,13 +259,12 @@ public final AcceptanceOfOfferBuilder part_Of_(final AgreementExecution agreemen

/**
* A {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#PART_OF} relationship type where a
* {@link SpatioTemporalExtent} may be {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#PART_OF}
* one or more {@link PossibleWorld}.
* {@link SpatioTemporalExtent} may be {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#PART_OF} one
* or more {@link PossibleWorld}.
*
* <p>
* Note: The relationship is optional because a {@link PossibleWorld} is not
* {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#PART_OF} any other
* {@link SpatioTemporalExtent}.
* {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#PART_OF} any other {@link SpatioTemporalExtent}.
* </p>
*
* @param possibleWorld The PossibleWorld.
Expand All @@ -279,8 +277,8 @@ public final AcceptanceOfOfferBuilder part_Of_Possible_World_M(final PossibleWor

/**
* A {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#REFERENCES} relationship type where an
* {@link AcceptanceOfOffer} {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#REFERENCES} exactly
* one {@link Offer} that is accepted.
* {@link AcceptanceOfOffer} {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#REFERENCES} exactly one
* {@link Offer} that is accepted.
*
* @param offer The Offer.
* @return Builder
Expand All @@ -306,16 +304,15 @@ public final AcceptanceOfOfferBuilder temporal__Part_Of(final SpatioTemporalExte
/**
* A {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#TEMPORAL_PART_OF} relationship type where a
* {@link uk.gov.gchq.magmacore.hqdm.model.State} may be a
* {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#TEMPORAL_PART_OF} one or more
* {@link Individual}.
* {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#TEMPORAL_PART_OF} one or more {@link Individual}.
*
* <p>
* Note: The relationship is optional because an {@link Individual} is not necessarily a
* {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#TEMPORAL_PART_OF} another {@link Individual},
* yet is a {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#MEMBER_OF}
* {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#TEMPORAL_PART_OF} another {@link Individual}, yet
* is a {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#MEMBER_OF}
* {@link uk.gov.gchq.magmacore.hqdm.model.State} as well as {@link Individual}. This applies to all
* subtypes of {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#TEMPORAL_PART_OF} that are between
* a {@code state_of_X} and {@code X}.
* subtypes of {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#TEMPORAL_PART_OF} that are between a
* {@code state_of_X} and {@code X}.
* </p>
*
* @param individual The Individual.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,8 @@ public final AcceptanceOfOfferForGoodsBuilder part__Of(final SpatioTemporalExten

/**
* A {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#PART_OF} relationship type where an
* {@link AcceptanceOfOfferForGoods} is a
* {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#PART_OF} exactly one
* {@link OfferAndAcceptanceForGoods}.
* {@link AcceptanceOfOfferForGoods} is a {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#PART_OF}
* exactly one {@link OfferAndAcceptanceForGoods}.
*
* @param offerAndAcceptanceForGoods The OfferAndAcceptanceForGoods.
* @return This builder.
Expand All @@ -245,8 +244,7 @@ public final AcceptanceOfOfferForGoodsBuilder part_Of_M(
/**
* A {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#PART_OF} relationship type where a
* {@link uk.gov.gchq.magmacore.hqdm.model.SociallyConstructedObject} may be a
* {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#PART_OF} one or more
* {@link AgreementExecution}.
* {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#PART_OF} one or more {@link AgreementExecution}.
*
* @param agreementExecution The AgreementExecution.
* @return This builder.
Expand All @@ -258,13 +256,12 @@ public final AcceptanceOfOfferForGoodsBuilder part_Of_(final AgreementExecution

/**
* A {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#PART_OF} relationship type where a
* {@link SpatioTemporalExtent} may be {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#PART_OF}
* one or more {@link PossibleWorld}.
* {@link SpatioTemporalExtent} may be {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#PART_OF} one
* or more {@link PossibleWorld}.
*
* <p>
* Note: The relationship is optional because a {@link PossibleWorld} is not
* {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#PART_OF} any other
* {@link SpatioTemporalExtent}.
* {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#PART_OF} any other {@link SpatioTemporalExtent}.
* </p>
*
* @param possibleWorld The PossibleWorld.
Expand Down Expand Up @@ -303,16 +300,15 @@ public final AcceptanceOfOfferForGoodsBuilder temporal__Part_Of(final SpatioTemp
/**
* A {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#TEMPORAL_PART_OF} relationship type where a
* {@link uk.gov.gchq.magmacore.hqdm.model.State} may be a
* {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#TEMPORAL_PART_OF} one or more
* {@link Individual}.
* {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#TEMPORAL_PART_OF} one or more {@link Individual}.
*
* <p>
* Note: The relationship is optional because an {@link Individual} is not necessarily a
* {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#TEMPORAL_PART_OF} another {@link Individual},
* yet is a {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#MEMBER_OF}
* {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#TEMPORAL_PART_OF} another {@link Individual}, yet
* is a {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#MEMBER_OF}
* {@link uk.gov.gchq.magmacore.hqdm.model.State} as well as {@link Individual}. This applies to all
* subtypes of {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#TEMPORAL_PART_OF} that are between
* a {@code state_of_X} and {@code X}.
* subtypes of {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#TEMPORAL_PART_OF} that are between a
* {@code state_of_X} and {@code X}.
* </p>
*
* @param individual The Individual.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ public final ActivityBuilder member__Of(final Class clazz) {

/**
* A {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#MEMBER_OF} relationship type where an
* {@link Activity} may be a {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#MEMBER_OF} one or
* more {@link ClassOfActivity}.
* {@link Activity} may be a {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#MEMBER_OF} one or more
* {@link ClassOfActivity}.
*
* @param classOfActivity The ClassOfActivity.
* @return This builder.
Expand Down Expand Up @@ -233,13 +233,12 @@ public final ActivityBuilder part_Of(final Activity activity) {

/**
* A {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#PART_OF} relationship type where a
* {@link SpatioTemporalExtent} may be {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#PART_OF}
* one or more {@link PossibleWorld}.
* {@link SpatioTemporalExtent} may be {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#PART_OF} one
* or more {@link PossibleWorld}.
*
* <p>
* Note: The relationship is optional because a {@link PossibleWorld} is not
* {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#PART_OF} any other
* {@link SpatioTemporalExtent}.
* {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#PART_OF} any other {@link SpatioTemporalExtent}.
* </p>
*
* @param possibleWorld The PossibleWorld.
Expand Down Expand Up @@ -277,16 +276,15 @@ public final ActivityBuilder temporal__Part_Of(final SpatioTemporalExtent spatio
/**
* A {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#TEMPORAL_PART_OF} relationship type where a
* {@link uk.gov.gchq.magmacore.hqdm.model.State} may be a
* {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#TEMPORAL_PART_OF} one or more
* {@link Individual}.
* {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#TEMPORAL_PART_OF} one or more {@link Individual}.
*
* <p>
* Note: The relationship is optional because an {@link Individual} is not necessarily a
* {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#TEMPORAL_PART_OF} another {@link Individual},
* yet is a {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#MEMBER_OF}
* {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#TEMPORAL_PART_OF} another {@link Individual}, yet
* is a {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#MEMBER_OF}
* {@link uk.gov.gchq.magmacore.hqdm.model.State} as well as {@link Individual}. This applies to all
* subtypes of {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#TEMPORAL_PART_OF} that are between
* a {@code state_of_X} and {@code X}.
* subtypes of {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#TEMPORAL_PART_OF} that are between a
* {@code state_of_X} and {@code X}.
* </p>
*
* @param individual The Individual.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ public final AgreeContractBuilder member__Of(final Class clazz) {

/**
* A {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#MEMBER_OF} relationship type where an
* {@link AgreeContract} may be a {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#MEMBER_OF} one
* or more {@link ClassOfAgreeContract}.
* {@link AgreeContract} may be a {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#MEMBER_OF} one or
* more {@link ClassOfAgreeContract}.
*
* @param classOfAgreeContract The ClassOfAgreeContract.
* @return Builder
Expand Down Expand Up @@ -254,8 +254,7 @@ public final AgreeContractBuilder part_Of_M(final ContractProcess contractProces
/**
* A {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#PART_OF} relationship type where a
* {@link uk.gov.gchq.magmacore.hqdm.model.SociallyConstructedObject} may be a
* {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#PART_OF} one or more
* {@link AgreementExecution}.
* {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#PART_OF} one or more {@link AgreementExecution}.
*
* @param agreementExecution The AgreementExecution.
* @return This builder.
Expand All @@ -267,13 +266,12 @@ public final AgreeContractBuilder part_Of_(final AgreementExecution agreementExe

/**
* A {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#PART_OF} relationship type where a
* {@link SpatioTemporalExtent} may be {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#PART_OF}
* one or more {@link PossibleWorld}.
* {@link SpatioTemporalExtent} may be {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#PART_OF} one
* or more {@link PossibleWorld}.
*
* <p>
* Note: The relationship is optional because a {@link PossibleWorld} is not
* {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#PART_OF} any other
* {@link SpatioTemporalExtent}.
* {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#PART_OF} any other {@link SpatioTemporalExtent}.
* </p>
*
* @param possibleWorld The PossibleWorld.
Expand Down Expand Up @@ -312,16 +310,15 @@ public final AgreeContractBuilder temporal__Part_Of(final SpatioTemporalExtent s
/**
* A {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#TEMPORAL_PART_OF} relationship type where a
* {@link uk.gov.gchq.magmacore.hqdm.model.State} may be a
* {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#TEMPORAL_PART_OF} one or more
* {@link Individual}.
* {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#TEMPORAL_PART_OF} one or more {@link Individual}.
*
* <p>
* Note: The relationship is optional because an {@link Individual} is not necessarily a
* {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#TEMPORAL_PART_OF} another {@link Individual},
* yet is a {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#MEMBER_OF}
* {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#TEMPORAL_PART_OF} another {@link Individual}, yet
* is a {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#MEMBER_OF}
* {@link uk.gov.gchq.magmacore.hqdm.model.State} as well as {@link Individual}. This applies to all
* subtypes of {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#TEMPORAL_PART_OF} that are between
* a {@code state_of_X} and {@code X}.
* subtypes of {@link uk.gov.gchq.magmacore.hqdm.rdf.iri.HQDM#TEMPORAL_PART_OF} that are between a
* {@code state_of_X} and {@code X}.
* </p>
*
* @param individual The Individual.
Expand Down
Loading

0 comments on commit bebcd16

Please sign in to comment.