This repository was archived by the owner on Aug 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from ec-europa/sparql-entity-query
Modernise the SPARQL entity query, fix some field handler issues and allow Rdf entity static loaders to pass graphs
- Loading branch information
Showing
11 changed files
with
134 additions
and
121 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
namespace Drupal\rdf_entity\Entity\Query\Sparql; | ||
|
||
use Drupal\Core\Entity\EntityTypeInterface; | ||
use Drupal\Core\Entity\Query\QueryInterface; | ||
use Drupal\rdf_entity\RdfEntitySparqlStorageInterface; | ||
|
||
/** | ||
* Provides an interface for SPARQL entity queries. | ||
*/ | ||
interface SparqlQueryInterface extends QueryInterface { | ||
|
||
/** | ||
* Sets the IDs of the graph to be queried. | ||
* | ||
* If this method is not called, the default graphs for this entity type are | ||
* used. Calling the method with no argument will remove any filtering of RDF | ||
* entities on graphs and the query will return all entities from all graphs | ||
* that are known by Drupal for this entity type. | ||
* | ||
* @param string[]|null $graph_ids | ||
* (optional) A list of graph IDs to filter on. If omitted, the query will | ||
* return all entities from all graphs that are known by Drupal for this | ||
* entity type. | ||
* | ||
* @return $this | ||
*/ | ||
public function graphs(array $graph_ids = NULL): self; | ||
|
||
/** | ||
* Returns the entity type. | ||
* | ||
* @return \Drupal\Core\Entity\EntityTypeInterface | ||
* The entity type object. | ||
*/ | ||
public function getEntityType(): EntityTypeInterface; | ||
|
||
/** | ||
* Returns the entity type storage. | ||
* | ||
* @return \Drupal\rdf_entity\RdfEntitySparqlStorageInterface | ||
* The entity type storage. | ||
*/ | ||
public function getEntityStorage(): RdfEntitySparqlStorageInterface; | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
namespace Drupal\rdf_entity\Exception; | ||
|
||
/** | ||
* Thrown when an unmapped field is requested. | ||
*/ | ||
class UnmappedFieldException extends \Exception {} |
Oops, something went wrong.