Join the AMA (Ask Me Anything) with the Firefox leadership team to celebrate Firefox 20th anniversary and discuss Firefox’s future on Mozilla Connect. Mark your calendar on Thursday, November 14, 18:00 - 20:00 UTC!

Αυτός ο ιστότοπος θα έχει περιορισμένη λειτουργικότητα, όσο εκτελούμε εργασίες συντήρησης για να βελτιώσουμε την εμπειρία σας. Αν ένα άρθρο δεν επιλύει το ζήτημά σας και θέλετε να κάνετε μια ερώτηση, η κοινότητα υποστήριξής μας είναι έτοιμη να σας βοηθήσει στο Twitter (@FirefoxSupport) και στο Reddit (/r/firefox).

Αναζήτηση στην υποστήριξη

Προσοχή στις απάτες! Δεν θα σας ζητήσουμε ποτέ να καλέσετε ή να στείλετε μήνυμα σε κάποιον αριθμό τηλεφώνου ή να μοιραστείτε προσωπικά δεδομένα. Αναφέρετε τυχόν ύποπτη δραστηριότητα μέσω της επιλογής «Αναφορά κατάχρησης».

Μάθετε περισσότερα

How can I export thousands of bookmarks to a database, given that JSON is schemaless, revisited?

  • 3 απαντήσεις
  • 7 έχουν αυτό το πρόβλημα
  • 2 προβολές
  • Τελευταία απάντηση από cor-el

more options

Lost all my work when I registered in another tab. Again:

Since 1999 I have been accumulating bookmarks. Most of them are related to a single project, and these have been filed as a foo/yr/mo hierachy. As the browser has evolved, some are tagged, some have keywords, some have descriptions characteristically modified ('GM: ' prefix) with commentary, etc.

I need to bring this hierachy to into a (probably PostGreSQL) database for analysis, but JSON is schemaless. I've read the Canovas and and Cabot paper Discovering Implicit Schemas in JSON Data (icwe2013-CanovasCabot.pdf). It's interesting work, but discovery tools would not tell me anything about e.g. how developers thought tags v keywords would be used.

I thought I would just ask for the schema (there is surely one in there), and any commentary Mozilla might care to provice. I would be happy to share the code in my intended data reduction pipeline.

Lost all my work when I registered in another tab. Again: Since 1999 I have been accumulating bookmarks. Most of them are related to a single project, and these have been filed as a foo/yr/mo hierachy. As the browser has evolved, some are tagged, some have keywords, some have descriptions characteristically modified ('GM: ' prefix) with commentary, etc. I need to bring this hierachy to into a (probably PostGreSQL) database for analysis, but JSON is schemaless. I've read the Canovas and and Cabot paper Discovering Implicit Schemas in JSON Data (icwe2013-CanovasCabot.pdf). It's interesting work, but discovery tools would not tell me anything about e.g. how developers thought tags v keywords would be used. I thought I would just ask for the schema (there is surely one in there), and any commentary Mozilla might care to provice. I would be happy to share the code in my intended data reduction pipeline.

Όλες οι απαντήσεις (3)

more options

The .json format used for bookmark backups has a well defined structure, but I'm not sure where it is documented. The JavaScript function that Firefox uses when reading the file can be viewed in the online source code repository here:

http://mxr.mozilla.org/mozilla-release/source/toolkit/components/places/BookmarkJSONUtils.jsm#342

The actual bookmarks as used by Firefox are stored in the places.sqlite database. If you would rather work with a relational database than a JSON file, you may be able to extract the data directly. The SQLite Manager extension is handy for browsing the tables and trying ad hoc SQL queries. However, please back up your database first.

more options

Here is a search of the Mozilla Developer Network website for json. Something there should be able to help you.
https://www.google.com/search?q=site:developer.mozilla.org%20json&ie=utf-8&oe=utf-8&lr=lang_en

more options

Tags are stored as a separate folder in a JSON backup and each bookmark is listed in the children array of the Tags folder.

{"index":2,"title":"Tags","id":4,"parent":1,"dateAdded":<epoch>,"lastModified":<epoch>,"type":"text/x-moz-place-container","root":"tagsFolder","children":[]}