-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to convert standard vCard into first-class JSON? #77
Comments
Sorry, ez-vcard does not produce the kind of JSON output you are looking for. |
Hi @mangstadt , thanks! Well, can I help to draft and perhaps develop something for ez-vcard? I understand that the reversibility ("round-tripping" as RFC 7095) is a key feature of jCard, and it is only possible with expresstions as The usual goal of non-reversible formats are to express in simplifyed (but also "standard") way the vCard information, for simpler applications... Perhaps the main demand is the construction of Semantic Web expressions, where SchemaOrg is today a de facto standard. See Person, Organization and ContactPoint. The key files seems JCardRawWriter.java and perhaps JsonValue.java... What do you suggest as a starting point? |
Before to move on, in this line of "simple and first-class JSON" (my preference), perhaps you want to check other complex reversible format, the JSON-LD as #78. If we confortable with "simple first", let me explain better. Maping vCard to SchemaOrg, with equivalences at xCard:
So there are two natural alternatives to reuse labels: from xCard or from SchemaOrg... But only SchemaOrg is a de facto standard, and express semantic hierarchy, so I prefer SchemaOrg. Example (from this Wikipedia example): ...
"Person":{
"name":"Forrest Gump",
"familyName":"Forrest",
"givenName":"Gump",
"honorificPrefix":"Mr.",
"address":"42 Plantation St.\nBaytown, LA 30314\nUnited States of America",
"PostalAddress":{
"streetAddress":"42 Plantation St.",
"city":"Baytown",
"postalCode":"30314",
"addressCountry":"United States of America"
},
"telephone":"+1-404-555-1212"
},
"Organization":{
"name":"Bubba Gump Shrimp Co.",
"telephone":"+1-111-555-1212",
"address":"100 Waters Edge\nBaytown, LA 30314\nUnited States of America",
"PostalAddress":{}
},
... |
I would treat it as an entirely new data format, and start by creating a new "writer" class. You could use one of the existing writer classes as a starting point. Because it's based on JSON, you could use the |
@ppKrauss I have written a JSON outputter using |
There are an ez-vcard option or parameter for it?
I need a stable and secure convertion, that produce the final output as "first class" JSON objects. Example:
jCard format:
[["version", {}, "text", "4.0"],["fn", {}, "text", "Forrest Gump"]]
First-class JSON format:
{"version":"4.0","fn":"Forrest Gump"}
.The text was updated successfully, but these errors were encountered: