File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -45,18 +45,20 @@ application/ld\+json # The type that indicates linked d
4545 ConvertFrom-Json
4646 ) {
4747 if ($jsonObject .' @type' ) {
48- $schemaType = $jsonObject .' @context' , $jsonObject .' @type' -join ' /'
48+ $schemaType = $jsonObject .' @context' , $jsonObject .' @type' -ne ' ' - join ' /'
4949 $jsonObject.pstypenames.insert (0 , $schemaType )
50- }
51-
52- if ($jsonObject .' @graph' ) {
50+ $jsonObject
51+ } elseif ($jsonObject .' @graph' ) {
5352 foreach ($graphObject in $jsonObject .' @graph' ) {
54- if ($graphObject .' @type' ) {
53+ if ($graphObject .' @type' ) {
5554 $graphObject.pstypenames.insert (0 , $graphObject .' @type' )
5655 }
57- }
56+ $graphObject
57+ }
58+ } else {
59+ $jsonObject
5860 }
59- $jsonObject
61+
6062 }
6163 }
6264 }
Original file line number Diff line number Diff line change 11# JSON-LD
2+
23Get JSON Linked Data with PowerShell
You can’t perform that action at this time.
0 commit comments