From: Loren C. <lor...@gm...> - 2018-07-06 19:14:15
|
Status of xqDoc projects: xqdoc-core https://github.com/lcahlander/xqdoc-core <https://github.com/lcahlander/xqdoc-core> Maven project for parsing XQuery scripts to xqDoc files. Duncan Paterson added connectivity to Travis. Test cases have been created to validate the code. More test cases need to be developed. Run mvn install to store the library in your local maven repository Documentation about the project needs to be created. xqDoc - eXist-db app https://github.com/lcahlander/xqDoc <https://github.com/lcahlander/xqDoc> Start of eXist-db EXPath package that includes xqdoc-core. Need to change the ExampleFunctions to parse an XQuery script and return an xqDoc file. Need to add the capability to scan all java classes to extract the xqDoc from the function modules Add an XQuery function module to scan all of the XQuery scripts within an app or all apps Create polymer web page for viewing xqDoc throughout the eXist-db database ml-xqdoc - MarkLogic implementation of xqDoc https://github.com/lcahlander/ml-xqDoc <https://github.com/lcahlander/ml-xqDoc> Need to plan an implementation using the xqdoc-core to process the xqDoc files from the sources. Request from group I would appreciate feedback from people to plan the progress of making xqDoc implemented throughout the XQuery sphere. All three repositories have a project setup for them. Thank you, Loren > On Jul 1, 2018, at 10:51 PM, Loren Cahlander <lor...@gm...> wrote: > > Here is the status of creating the xqdoc-core maven project. https://github.com/lcahlander/xqdoc-core <https://github.com/lcahlander/xqdoc-core> > > The antler file under org.xqdoc.xquery.parser.jul2017 has all of the capabilities of the current MarkLogic implementation. I still need to add the parts of XQuery 3.1 that are not implemented in MarkLogic. > > For a proper Maven project, the testing capability needs to be implemented. > > I now have a successful testing of the processing of an XQuery source file to an xqdoc file comparing against a control document. > > Any XQuery in test/resources/XQuery has its xqDoc generated and compared against the control xqDoc file in test/resources/xqDoc. > > I only have a test agains the FunctX XQuery script. More scripts to come, including testing against the capabilities of XQuery 3.1. > > Once this finally passes muster, then I hope that it will be transferred to the EXQuery GitHub account. > > After that, I will create an xqDoc EXPath application for eXist-db that is dependent on the xqdoc-core project. > > > >> On Jun 29, 2018, at 1:16 PM, Adam Retter <ad...@ex... <mailto:ad...@ex...>> wrote: >> >> Loren, >> >> Probably best to start by writing a single JUnit test that works for one input query and compares the results against one xml file. Once you have that working, we can talk about how to abstract it to work for different inputs and outputs. >> >> On 28 June 2018 at 18:55, Loren Cahlander <lor...@gm... <mailto:lor...@gm...>> wrote: >> Folks, >> >> I have not done any JUnit development in a long time. Can any of you let me know what type of test to develop? >> >> Here is the test resource structure: >> >> <PastedGraphic-1.png> >> >> What I want to do is run the xqDoc generator against each file in the test/resources/XQuery and compare it against its corresponding file in test/resources/xqDoc. Each document in the XQuery folder is an individual test and should have its own test result. >> >> Thanks for any help, >> Loren >> >>> On Jun 27, 2018, at 9:24 PM, Loren Cahlander <lor...@gm... <mailto:lor...@gm...>> wrote: >>> >>> The xqDoc core library project is available at: https://github.com/lcahlander/xqdoc-core <https://github.com/lcahlander/xqdoc-core> >>> >>> >>> TBD: >>> create the code to process and report the test cases >>> Create test cases and test what the test should generate >>> Move xqdoc-core to the EXQuery GitHub project >>> Register the project with the maven project >>> Develop an eXist EXPath function module that has a dependency on xqdoc-core >>> Develop a WAR project that has a dependency on xqdoc-core >>> >>> Below is the README >>> >>> xqdoc-core >>> >>> Core module to process XQuery code source to an xqDoc XML file >>> >>> <https://github.com/lcahlander/xqdoc-core#building>Building >>> >>> Run the command: mvn clean install assembly:single >>> >>> Dependencies >>> >>> antlr >>> commons-cli >>> Results >>> >>> target/xqdoc-core-0.8-jar-with-dependencies.jar >>> target/xqdoc-core-0.8.jar >>> ##Command Line Call >>> >>> java -jar xqdoc-core-0.8-jar-with-dependencies.jar -Dprefix=uri -Dprefix=uri -f filepath >>> >>> The prefix/uri combination is for the prefixes that are not needed in an import module namespace for the implementation. >>> >>> e.g. -Dfn=http://www.w3.org/2003/05/xpath-functions <http://www.w3.org/2003/05/xpath-functions> is for the default XPath function library. This prefix/namespace is included by default. >>> >>> The filepath is the path name to the file with the XQuery source. >>> >>> <https://github.com/lcahlander/xqdoc-core#calling-from-java>Calling from java >>> >>> HashMap uriMap = new HashMap(); >>> uriMap.put(XPathDriver.XPATH_PREFIX, XPathDriver.XPATH_URI); >>> InputStream is = Files.newInputStream(Paths.get(cmd.getOptionValue("f"))); >>> controller = new XQDocController(XQDocController.JUL2017); >>> controller.setPredefinedFunctionNamespaces(uriMap); >>> >>> XQDocPayload payload = controller.process(is, ""); >>> DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); >>> DocumentBuilder db = dbf.newDocumentBuilder(); >>> InputSource isOut = new InputSource(); >>> isOut.setCharacterStream(new StringReader(payload.getXQDocXML())); >>> >>> Document doc = db.parse(isOut); >>> >>> >>> >>> >> >> >> >> >> -- >> Adam Retter >> >> eXist Core Developer >> { United Kingdom / United States } >> ad...@ex... <mailto:ad...@ex...> > |