Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Ontology #98

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@
"phpunit/phpunit": "~9.0",
"mockery/mockery": "^1.4",
"infection/infection": "^0.26",
"symplify/easy-coding-standard": "^9.0"
"symplify/easy-coding-standard": "^9.0",
"jeroen-g/ontology": "*"
},
"minimum-stability": "dev",
"autoload": {
"psr-4": {
"JeroenG\\Explorer\\": "src/"
Expand All @@ -40,5 +42,14 @@
"JeroenG\\Explorer\\ExplorerServiceProvider"
]
}
},
"repositories": {
"jeroen-g/ontology": {
"type": "path",
"url": "/Users/jgroenendijk/Sites/projects/packagertest/packages/JeroenG/Ontology",
"options": {
"symlink": true
}
}
}
}
62 changes: 62 additions & 0 deletions docs/bibliography.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Bibliography

### JeroenG\Explorer\Domain\Syntax\DisjunctionMax
- [Official documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-dis-max-query.html)


### JeroenG\Explorer\Domain\Syntax\Exists
- [Official documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-exists-query.html)


### JeroenG\Explorer\Domain\Syntax\Invert
- [Official documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-bool-query.html)


### JeroenG\Explorer\Domain\Syntax\MatchAll
- [Official documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-all-query.html)


### JeroenG\Explorer\Domain\Syntax\MatchPhrase
- [Official documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query-phrase.html)


### JeroenG\Explorer\Domain\Syntax\Matching
- [Official documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query.html)


### JeroenG\Explorer\Domain\Syntax\MultiMatch
- [Official documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-multi-match-query.html)


### JeroenG\Explorer\Domain\Syntax\Nested
- [Official documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/nested.html)


### JeroenG\Explorer\Domain\Syntax\QueryString
- [Official documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html)


### JeroenG\Explorer\Domain\Syntax\Range
- [Official documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-range-query.html)


### JeroenG\Explorer\Domain\Syntax\SimpleQueryString
- [Official documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html)


### JeroenG\Explorer\Domain\Syntax\Sort
- [Official documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/sort-search-results.html)


### JeroenG\Explorer\Domain\Syntax\Term
- [Official documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-term-query.html)


### JeroenG\Explorer\Domain\Syntax\Terms
- [Official documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-terms-query.html)


### JeroenG\Explorer\Domain\Syntax\Wildcard
- [Official documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-wildcard-query.html)


1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Also do not forget to follow the [installation instructions for Laravel Scout](h
# Explorer documentation

- [Quickstart](quickstart.md)
- [Bibliography](bibliography.md)
- [Mapping properties in Elasticsearch](mapping.md)
- [Sorting search results](sorting.md)
- [Pagination and search result size](pagination.md)
Expand Down
20 changes: 20 additions & 0 deletions ontology.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

declare(strict_types=1);

use JeroenG\Ontology\Application\ConfigurationConfigurator;

return static function (ConfigurationConfigurator $configurator): ConfigurationConfigurator {
return $configurator
->setDomainLayers(['Domain'])
->setApplicationLayers(['Application'])
->setInfrastructureLayers(['Infrastructure'])
->setGenerators([
JeroenG\Ontology\Domain\Generators\Bibliography::class,
])
->setValidators([
JeroenG\Ontology\Domain\Validators\Hexagonal\Repository::class,
JeroenG\Ontology\Domain\Validators\ValueObject\Immutable::class,
])
;
};
3 changes: 3 additions & 0 deletions src/Domain/Syntax/DisjunctionMax.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

namespace JeroenG\Explorer\Domain\Syntax;

use JeroenG\Ontology\Domain\Attributes as DDD;

#[DDD\Www('Official documentation', 'https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-dis-max-query.html')]
class DisjunctionMax implements SyntaxInterface
{
/** @var SyntaxInterface[] */
Expand Down
3 changes: 3 additions & 0 deletions src/Domain/Syntax/Exists.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

namespace JeroenG\Explorer\Domain\Syntax;

use JeroenG\Ontology\Domain\Attributes as DDD;

#[DDD\Www('Official documentation', 'https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-exists-query.html')]
class Exists implements SyntaxInterface
{
private string $field;
Expand Down
3 changes: 3 additions & 0 deletions src/Domain/Syntax/Invert.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

namespace JeroenG\Explorer\Domain\Syntax;

use JeroenG\Ontology\Domain\Attributes as DDD;

#[DDD\Www('Official documentation', 'https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-bool-query.html')]
class Invert implements SyntaxInterface
{
private SyntaxInterface $query;
Expand Down
3 changes: 3 additions & 0 deletions src/Domain/Syntax/MatchAll.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

namespace JeroenG\Explorer\Domain\Syntax;

use JeroenG\Ontology\Domain\Attributes as DDD;

#[DDD\Www('Official documentation', 'https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-all-query.html')]
class MatchAll implements SyntaxInterface
{
public function build(): array
Expand Down
3 changes: 3 additions & 0 deletions src/Domain/Syntax/MatchPhrase.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

namespace JeroenG\Explorer\Domain\Syntax;

use JeroenG\Ontology\Domain\Attributes as DDD;

#[DDD\Www('Official documentation', 'https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query-phrase.html')]
class MatchPhrase implements SyntaxInterface
{
private string $field;
Expand Down
3 changes: 3 additions & 0 deletions src/Domain/Syntax/Matching.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

namespace JeroenG\Explorer\Domain\Syntax;

use JeroenG\Ontology\Domain\Attributes as DDD;

#[DDD\Www('Official documentation', 'https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query.html')]
class Matching implements SyntaxInterface
{
private string $field;
Expand Down
3 changes: 3 additions & 0 deletions src/Domain/Syntax/MultiMatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

namespace JeroenG\Explorer\Domain\Syntax;

use JeroenG\Ontology\Domain\Attributes as DDD;

#[DDD\Www('Official documentation', 'https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-multi-match-query.html')]
class MultiMatch implements SyntaxInterface
{
private mixed $value;
Expand Down
3 changes: 3 additions & 0 deletions src/Domain/Syntax/Nested.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

namespace JeroenG\Explorer\Domain\Syntax;

use JeroenG\Ontology\Domain\Attributes as DDD;

#[DDD\Www('Official documentation', 'https://www.elastic.co/guide/en/elasticsearch/reference/current/nested.html')]
class Nested implements SyntaxInterface
{
private string $path;
Expand Down
2 changes: 2 additions & 0 deletions src/Domain/Syntax/QueryString.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
namespace JeroenG\Explorer\Domain\Syntax;

use Webmozart\Assert\Assert;
use JeroenG\Ontology\Domain\Attributes as DDD;

#[DDD\Www('Official documentation', 'https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html')]
class QueryString implements SyntaxInterface
{
public const OP_AND = 'AND';
Expand Down
2 changes: 2 additions & 0 deletions src/Domain/Syntax/Range.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
namespace JeroenG\Explorer\Domain\Syntax;

use Webmozart\Assert\Assert;
use JeroenG\Ontology\Domain\Attributes as DDD;

#[DDD\Www('Official documentation', 'https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-range-query.html')]
class Range implements SyntaxInterface
{
public const RELATIONS = ['gt', 'gte', 'lt', 'lte'];
Expand Down
3 changes: 3 additions & 0 deletions src/Domain/Syntax/SimpleQueryString.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

namespace JeroenG\Explorer\Domain\Syntax;

use JeroenG\Ontology\Domain\Attributes as DDD;

#[DDD\Www('Official documentation', 'https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html')]
class SimpleQueryString extends QueryString
{
public function build(): array
Expand Down
2 changes: 2 additions & 0 deletions src/Domain/Syntax/Sort.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
namespace JeroenG\Explorer\Domain\Syntax;

use Webmozart\Assert\Assert;
use JeroenG\Ontology\Domain\Attributes as DDD;

#[DDD\Www('Official documentation', 'https://www.elastic.co/guide/en/elasticsearch/reference/current/sort-search-results.html')]
class Sort implements SyntaxInterface
{
public const ASCENDING = 'asc';
Expand Down
5 changes: 4 additions & 1 deletion src/Domain/Syntax/Term.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@

namespace JeroenG\Explorer\Domain\Syntax;

use JeroenG\Ontology\Domain\Attributes as DDD;

#[DDD\Www('Official documentation', 'https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-term-query.html')]
class Term implements SyntaxInterface
{
private string $field;

private mixed $value;

private ?float $boost;
Expand Down
2 changes: 2 additions & 0 deletions src/Domain/Syntax/Terms.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
namespace JeroenG\Explorer\Domain\Syntax;

use Webmozart\Assert\Assert;
use JeroenG\Ontology\Domain\Attributes as DDD;

#[DDD\Www('Official documentation', 'https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-terms-query.html')]
class Terms implements SyntaxInterface
{
private string $field;
Expand Down
3 changes: 3 additions & 0 deletions src/Domain/Syntax/Wildcard.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

namespace JeroenG\Explorer\Domain\Syntax;

use JeroenG\Ontology\Domain\Attributes as DDD;

#[DDD\Www('Official documentation', 'https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-wildcard-query.html')]
class Wildcard implements SyntaxInterface
{
private string $field;
Expand Down