Skip to content

A Scala Parser Combinators Implementation for ODATA URI

License

Notifications You must be signed in to change notification settings

Yogeshberia/odatauriparser

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Parser for ODATA URI

This project builds a parser for subset of ODATA URI. Main objective is to parse a URI such as http://odata.io/odata.svc/Schema(231)/Customer?$top=2&$filter=concat(City, Country) eq 'Berlin, Germany' and builds an AST as follows:

ODataQuery(
    URL("http://odata.io/odata.svc"),
    ResourcePath("Schema",Number("231"),ResourcePath("Customer",EmptyExp(),EmptyExp())),
    QueryOperations(
      List(Top(Number("2")),
      Filter(
        EqualToExp(
          CallExp(
              Property("concat")
            , List(Property("City"), Property("Country"))
          )
          , StringLiteral("'Berlin, Germany'"))))))

It uses Scala Parser Combinators to parse the URI string and builds an AST for that for further processing.

For more example, see unit tests included in the project (e.g., see OdataUriParseTests.scala).

See http://www.odata.org/documentation/odata-version-2-0/uri-conventions/ for more details regarding the URI specification.

About

A Scala Parser Combinators Implementation for ODATA URI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Scala 100.0%