Skip to content

Commit

Permalink
#356 Move this[] accessor down to RDFStore level
Browse files Browse the repository at this point in the history
  • Loading branch information
mdesalvo committed Jan 25, 2025
1 parent e96546e commit 98cded0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion RDFSharp/Model/RDFGraph.cs
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ public Task<RDFGraph> SelectTriplesByLiteralAsync(RDFLiteral literal)

/// <summary>
/// Gets the subgraph containing triples with the specified combination of SPOL accessors<br/>
/// (null values are threated as * selectors. Ensure to keep object and literal mutually exclusive!)
/// (null values are handled as * selectors. Ensure to keep object and literal mutually exclusive!)
/// </summary>
public RDFGraph this[RDFResource subj, RDFResource pred, RDFResource obj, RDFLiteral lit]
=> (obj != null && lit != null) ? throw new RDFModelException("Cannot access a graph when both object and literals are given: they must be mutually exclusive!")
Expand Down
8 changes: 0 additions & 8 deletions RDFSharp/Store/Engines/RDFMemoryStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -593,14 +593,6 @@ public override void ClearQuadruples()
public override bool ContainsQuadruple(RDFQuadruple quadruple)
=> quadruple != null && IndexedQuadruples.ContainsKey(quadruple.QuadrupleID);

/// <summary>
/// Gets a store containing quadruples with the specified combination of CSPOL accessors<br/>
/// (null values are threated as * selectors. Ensure to keep object and literal mutually exclusive!)
/// </summary>
public RDFMemoryStore this[RDFContext ctx, RDFResource subj, RDFResource pred, RDFResource obj, RDFLiteral lit]
=> (obj != null && lit != null) ? throw new RDFStoreException("Cannot access a memory store when both object and literals are given: they must be mutually exclusive!")
: SelectQuadruples(ctx, subj, pred, obj, lit);

/// <summary>
/// Gets a store containing quadruples satisfying the given pattern
/// </summary>
Expand Down
8 changes: 8 additions & 0 deletions RDFSharp/Store/RDFStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,14 @@ public Task UnreifyQuadruplesAsync()
#endregion

#region Select
/// <summary>
/// Gets a memory store containing quadruples with the specified combination of CSPOL accessors<br/>
/// (null values are handled as * selectors. Ensure to keep object and literal mutually exclusive!)
/// </summary>
public RDFMemoryStore this[RDFContext ctx, RDFResource subj, RDFResource pred, RDFResource obj, RDFLiteral lit]
=> (obj != null && lit != null) ? throw new RDFStoreException("Cannot access a store when both object and literals are given: they must be mutually exclusive!")
: SelectQuadruples(ctx, subj, pred, obj, lit);

/// <summary>
/// Checks if the store contains the given quadruple
/// </summary>
Expand Down

0 comments on commit 98cded0

Please sign in to comment.