Title: Should setting id_ only set the local part of the ID? · Issue #222 · STIXProject/python-stix · GitHub
Open Graph Title: Should setting id_ only set the local part of the ID? · Issue #222 · STIXProject/python-stix
X Title: Should setting id_ only set the local part of the ID? · Issue #222 · STIXProject/python-stix
Description: Right now, properly setting custom IDs is somewhat counter-intuitive (to me). The python-stix documentation has information on setting ID namespaces [1], which at present boils down to set_id_namespace({"http://MY-NAMESPACE.com" : "myNS"...
Open Graph Description: Right now, properly setting custom IDs is somewhat counter-intuitive (to me). The python-stix documentation has information on setting ID namespaces [1], which at present boils down to set_id_names...
X Description: Right now, properly setting custom IDs is somewhat counter-intuitive (to me). The python-stix documentation has information on setting ID namespaces [1], which at present boils down to set_id_names...
Opengraph URL: https://github.com/STIXProject/python-stix/issues/222
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Should setting id_ only set the local part of the ID?","articleBody":"Right now, properly setting custom IDs is somewhat counter-intuitive (to me).\n\nThe python-stix documentation has information on setting ID namespaces [1], which at present boils down to `set_id_namespace({\"http://MY-NAMESPACE.com\" : \"myNS\"})` which causes `myNS` to be registered as an alias for `http://MY-NAMESPACE.com`.\n\nAfter setting the namespace, IDs currently need to be set with the namespace alias in mind. For example: `sp = STIXPackage(id_='myNS:SomeID')` is required if you want to use `SomeID` instead of an auto-generated ID. However, I think this might trip some people up. I think some people would expect the `id_` kwarg to just set the local part, and that the API would automatically prepend the alias (e.g., `myNS`). For example, I could see people thinking that `sp = STIXPackage(id_='local_part_only')` would create a valid ID because the APIs would \"know\" to prepend the NS alias.\n\nThis issue is to discuss this point of view and, should there be a consensus, possibly modify the implementation of IDs. One outcome could be that if there is not a namespace alias set in the `id_` property, use the ID namespace. If there is a namespace alias set in the `id_` property, use the specified namespace alias.\n\nThoughts?\n\nNote: https://github.com/STIXProject/python-stix/issues/176 might be related\n\n[1] http://stix.readthedocs.org/en/latest/examples/index.html#id-namespaces\n","author":{"url":"https://github.com/MarkDavidson","@type":"Person","name":"MarkDavidson"},"datePublished":"2014-10-27T16:29:04.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/222/python-stix/issues/222"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:54ce19ef-92bf-4103-f56b-7b10af983ddd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C68A:3476BC:2A5F67D:3B838E7:697105EB |
| html-safe-nonce | 4eb1f0eeac67c955268fe01768dce3c6b7d33e74b90d1a4f665db6c0bb8e6ae0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNjhBOjM0NzZCQzoyQTVGNjdEOjNCODM4RTc6Njk3MTA1RUIiLCJ2aXNpdG9yX2lkIjoiNjU5MDY5ODE1NDM3NjYyNzY5MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 341923597fcee63f26826df61bf48d44d7986d3497ae6d90a2ec734c45a8fe76 |
| hovercard-subject-tag | issue:46926973 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/STIXProject/python-stix/222/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b3fd2f2e763ac378e93cd411de240f78c88a5a7ae8d9bbcd145404e8eccf0f3f/STIXProject/python-stix/issues/222 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b3fd2f2e763ac378e93cd411de240f78c88a5a7ae8d9bbcd145404e8eccf0f3f/STIXProject/python-stix/issues/222 |
| og:image:alt | Right now, properly setting custom IDs is somewhat counter-intuitive (to me). The python-stix documentation has information on setting ID namespaces [1], which at present boils down to set_id_names... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | MarkDavidson |
| hostname | github.com |
| expected-hostname | github.com |
| None | 6d0e7b0d5e294a53c55f49e80755e785182080c6e6a48c9ed353bedddaee69f4 |
| turbo-cache-control | no-preview |
| go-import | github.com/STIXProject/python-stix git https://github.com/STIXProject/python-stix.git |
| octolytics-dimension-user_id | 2774079 |
| octolytics-dimension-user_login | STIXProject |
| octolytics-dimension-repository_id | 8163746 |
| octolytics-dimension-repository_nwo | STIXProject/python-stix |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 8163746 |
| octolytics-dimension-repository_network_root_nwo | STIXProject/python-stix |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 6d5a3a396bc74e65fd3ef897b0a99a6e489debaa |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width