statedecoded / statedecoded

Legal codes, for humans.
https://www.statedecoded.com/
Other
249 stars 53 forks source link

Parser not finding any laws #540

Closed lightningdev45 closed 10 years ago

lightningdev45 commented 10 years ago

I have installed using the vagrant install repo; All of the admin tests are passing. I am simply testing out the the sample xml file from the documentation. I have placed the file in the /var/www/statedecoded/htdocs/admin/import-data/ but I am still getting the following error:

Beginning import Environment test succeeded Importing Parsing data files Updating laws_references Deleting unresolved laws_references Breaking up law histories Replace old view Done Building Permalinks Writing API key Using the existing API key Preparing to export bulk downloads Querying laws Building dictionary Done Generating sitemap.xml No laws could be found to export to the sitemap No files were found in /var/www/statedecoded/htdocs/downloads/code-xml/—could not index laws with Solr. Generating structural statistics Pruning view records greater than one year old Done

What am I doing wrong?

waldoj commented 10 years ago

I suspect what's wrong is that the file you're copying is the ZIP file, rather than all of the XML files. The parser looks for all of the individual XML files, and doesn't know what to do with a ZIP file. Try unzipping the file first.

We'll have to be explicit about this in the instructions!

lightningdev45 commented 10 years ago

Just to be clear here is the sample xml file I am using(directly from the documentation). I know the parser is working because I can find pages displaying content related to the two unit tags. The content can be found at http://192.168.42.33/18.2/ and http://192.168.42.33/18.2/6/. However, I can't seem to find any of the content relating to the actual law(from the section tag).

<?xml version="1.0" encoding="utf-8"?>

Crimes and Offenses Generally Crimes Involving Fraud 18.2-186 False statements to obtain property or credit. 00000000009104318.2
Notwithstanding § 18.2-186: ```
A person shall be guilty of a Class 1 misdemeanor if he makes, causes to be made or conspires to make directly, indirectly or through an agency, any materially false statement in writing, knowing it to be false and intending that it be relied upon, concerning the financial condition or means or ability to pay of himself, or of any other person for whom he is acting, or any firm or corporation in which he is interested or for which he is acting, for the purpose of procuring, for his own benefit or for the benefit of such person, firm or corporation, the delivery of personal property, the payment of cash, the making of a loan or credit, the extension of a credit, the discount of an account receivable, or the making, acceptance, discount, sale or endorsement of a bill of exchange or promissory note.
Any person who knows that a false statement has been made in writing concerning the financial condition or ability to pay of himself or of any person for whom he is acting, or any firm or corporation in which he is interested or for which he is acting and who, with intent to defraud, procures, upon the faith thereof.
+------------------+--------------------+ | PERSON | STATEMENT | +------------------+--------------------+ | any | false | | no | true | +------------------+--------------------+
For his own benefit, or for the benefit of the person, firm or corporation in which he is interested or for which he is acting, any such delivery, payment, loan, credit, extension, discount making, acceptance, sale or endorsement, shall, if the value of the thing or the amount of the loan, credit or benefit obtained is $200 or more, be guilty of grand larceny or, if the value is less than $200, be guilty of petit larceny.
Venue for the trial of any person charged with an offense under this section may be in the county or city in which (i) any act was performed in furtherance of the offense, or (ii) the person charged with the offense resided at the time of the offense.
As used in this section, "in writing" shall include information transmitted by computer, facsimile, e-mail, Internet, or any other electronic medium, and shall not include information transmitted by any such medium by voice transmission.
This law shall expire on July 1, 2014.
Code 1950, § 18.1-125; 1960, c. 358; 1975, cc. 14, 15. y 2014-07-01 lying fraud theft ```
lightningdev45 commented 10 years ago

Also, by adding the default xml file to /var/www/statedecoded/htdocs/downloads/code-xml/ one of the errors went away. The new error message is as follows:

Beginning import Environment test succeeded Importing Parsing data files Updating laws_references Deleting unresolved laws_references Breaking up law histories Replace old view Done Building Permalinks Writing API key Using the existing API key Preparing to export bulk downloads Querying laws Building dictionary Done Generating sitemap.xml No laws could be found to export to the sitemap

waldoj commented 10 years ago

Hmm. You might try downloading XML from a live site (e.g., D.C.'s) and importing that, or at least a subset of that collection of laws (e.g., the first 100 laws from the ZIP file). It's possible that we failed to keep that example up-to-date in the documentation as the standard evolved, although I thought I'd been pretty good about that.

lightningdev45 commented 10 years ago

Hmm it is working with that file. I'll see what is wrong with the example in the documentation tomorrow.

waldoj commented 10 years ago

I'll worry about debugging the example—you've got enough work to do getting the Miami-Dade laws online! :)