Skip to content

Instantly share code, notes, and snippets.

@sbespalov
Last active March 25, 2018 15:54
Show Gist options
  • Save sbespalov/041870a3fdc94433eb241e2c26f43edc to your computer and use it in GitHub Desktop.
Save sbespalov/041870a3fdc94433eb241e2c26f43edc to your computer and use it in GitHub Desktop.
AQL Syntax

Query token

Each query consist of Tokens.

Token is a pair of <identifyer>:<value> separated with :.

Following common Identifyers supported:

Identifyer Description
storage storage ID
repository repository ID
layout repository layout name
tag avaliable tag name
from uploading date from (unicode format)
to uploading date to (unicode format)
age constant: day, month, year, etc.
asc ascending order
desc descending order

Also there is layout specific Identifiers:

Maven
Identifyer
groupId
artifactId
version
Nuget
Identifyer
Id
Version
Npm
Identifyer
scope
name
version

Values can be strings:

  • quotet with single quotes ' if needed (Valid Examples: storage: storage0, layout: 'Maven 2')
  • separated with comma , (Valid Examples: repository: releases, snapshots, layout: 'Maven 2', NuGet)
  • wiledcards supported * (Valid Examples: group: org.carlspring.*)

Values can be dates in unicode format: 2018-03-21 13:00:00

Values can be keywords/constants: day, month, year, etc.

Query expression

Tokens in query are combined into an expression:

storage:storage0 repository:releases

Expression parts can be surrounded by round brackets.

(storage:storage0)(repository:releases)

means same as

storage:storage0 repository:releases

means same as

((storage:storage0) (repository:releases))

Expression parts can be joined by logical operators:

  • AND is implied by default and means logical conjuncion (equivalent synonymous: &,&&)
  • OR means logical disjunction (equivalent synonymous: |,||)

(storage:storage0)(repository:releases)

means same as

(storage:storage0) AND (repository:releases)

means same as

storage:storage0 && repository:releases

Expression parts can be prefixed with negation or no negation

  • + is implied by default and means no negation (by and large does not mean anything, you can use it simply for clarity)
  • - means logical negation

+(storage:storage0)+(repository:releases)-(groupId: 'org.carlspring')

means same as

storage:storage0 AND +repository:releases AND NOT groupId: 'org.carlspring'

means same as

storage:storage0 repository:releases NOT groupId: 'org.carlspring'

@carlspring
Copy link

carlspring commented Mar 22, 2018

Identifiers should be renamed to coordinates.

Also Maven's coordinates include two more -- type and classifier.

This looks good to me!

@carlspring
Copy link

carlspring commented Mar 25, 2018

I've been thinking that we'll need to have a separate field like the ALIAS for the layout providers that exposes a single word as the layout provider's key, so that you don't have to write Maven 2 (and it will be just maven).

Another thing... it will have to be possible to have all these values as case insensitive for the layout providers (and quite-likely for a lot (if not most) of the other fields).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment