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!

חיפוש בתמיכה

יש להימנע מהונאות תמיכה. לעולם לא נבקש ממך להתקשר או לשלוח הודעת טקסט למספר טלפון או לשתף מידע אישי. נא לדווח על כל פעילות חשודה באמצעות באפשרות ״דיווח על שימוש לרעה״.

מידע נוסף

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

  • 3 תגובות
  • 7 have this problem
  • 2 views
  • תגובה אחרונה מאת 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":[]}