Skip to content

Commit b0d00e1

Browse files
author
James Brundage
committed
feat: Get-JsonJD - unrolling .'@graph' ( Fixes #2, re #9 )
Also updating tests
1 parent e5b1422 commit b0d00e1

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Commands/Get-JsonLD.ps1

+4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ function Get-JsonLD {
1212
.EXAMPLE
1313
# Want information about an article? Lots of news sites use this format.
1414
Get-JsonLD https://www.thebulwark.com/p/mahmoud-khalil-immigration-detention-first-amendment-free-speech-rights
15+
.EXAMPLE
16+
# Want to get information about a schema?
17+
jsonld https://schema.org/Movie
18+
# Get-JSONLD will output the contents of a `@Graph` object if no `@type` is found.
1519
#>
1620
[Alias('jsonLD','json-ld')]
1721
param(

JSON-LD.tests.ps1

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ describe 'JSON-LD' {
77

88
}
99
it 'can get information a schema' {
10-
$result = Get-JsonLD -Url 'https://schema.org/Movie'
11-
$result.'@graph' | Should -Not -BeNullOrEmpty
10+
Get-JsonLD https://schema.org/Movie |
11+
Select-Object -ExpandProperty pstypenames -Unique |
12+
Should -Contain 'rdf:Property'
1213
}
1314
}
1415
}

0 commit comments

Comments
 (0)