@@ -120,7 +120,7 @@ public virtual JToken Compact(Context activeCtx, string activeProperty, JToken e
120
120
// 6)
121
121
JObject result = new JObject ( ) ;
122
122
// 7)
123
- JArray keys = new JArray ( elem . Keys ) ;
123
+ JArray keys = new JArray ( element . GetKeys ( ) ) ;
124
124
keys . SortInPlace ( ) ;
125
125
foreach ( string expandedProperty in keys )
126
126
{
@@ -170,7 +170,7 @@ public virtual JToken Compact(Context activeCtx, string activeProperty, JToken e
170
170
// 7.2.1)
171
171
JObject compactedValue = ( JObject ) Compact ( activeCtx , "@reverse" , expandedValue , compactArrays ) ;
172
172
// 7.2.2)
173
- List < string > properties = new List < string > ( ( ( IDictionary < string , JToken > ) compactedValue ) . Keys ) ;
173
+ List < string > properties = new List < string > ( compactedValue . GetKeys ( ) ) ;
174
174
foreach ( string property in properties )
175
175
{
176
176
JToken value = compactedValue [ property ] ;
@@ -489,7 +489,7 @@ public virtual JToken Expand(Context activeCtx, string activeProperty, JToken el
489
489
// 6)
490
490
JObject result = new JObject ( ) ;
491
491
// 7)
492
- JArray keys = new JArray ( elem . Keys ) ;
492
+ JArray keys = new JArray ( element . GetKeys ( ) ) ;
493
493
keys . SortInPlace ( ) ;
494
494
foreach ( string key in keys )
495
495
{
@@ -679,7 +679,7 @@ public virtual JToken Expand(Context activeCtx, string activeProperty, JToken el
679
679
if ( ( ( IDictionary < string , JToken > ) expandedValue ) . ContainsKey ( "@reverse" ) )
680
680
{
681
681
JObject reverse = ( JObject ) ( ( JObject ) expandedValue ) [ "@reverse" ] ;
682
- foreach ( string property in ( ( IDictionary < string , JToken > ) reverse ) . Keys )
682
+ foreach ( string property in reverse . GetKeys ( ) )
683
683
{
684
684
JToken item = reverse [ property ] ;
685
685
// 7.4.11.2.1)
@@ -709,7 +709,7 @@ public virtual JToken Expand(Context activeCtx, string activeProperty, JToken el
709
709
// 7.4.11.3.2)
710
710
JObject reverseMap = ( JObject ) result [ "@reverse" ] ;
711
711
// 7.4.11.3.3)
712
- foreach ( string property in ( ( IDictionary < string , JToken > ) expandedValue ) . Keys )
712
+ foreach ( string property in expandedValue . GetKeys ( ) )
713
713
{
714
714
if ( "@reverse" . Equals ( property ) )
715
715
{
@@ -771,7 +771,7 @@ public virtual JToken Expand(Context activeCtx, string activeProperty, JToken el
771
771
// 7.5.1)
772
772
expandedValue = new JArray ( ) ;
773
773
// 7.5.2)
774
- foreach ( string language in ( ( IDictionary < string , JToken > ) value ) . Keys )
774
+ foreach ( string language in value . GetKeys ( ) )
775
775
{
776
776
JToken languageValue = ( ( IDictionary < string , JToken > ) value ) [ language ] ;
777
777
// 7.5.2.1)
@@ -806,7 +806,7 @@ public virtual JToken Expand(Context activeCtx, string activeProperty, JToken el
806
806
// 7.6.1)
807
807
expandedValue = new JArray ( ) ;
808
808
// 7.6.2)
809
- JArray indexKeys = new JArray ( ( ( IDictionary < string , JToken > ) value ) . Keys ) ;
809
+ JArray indexKeys = new JArray ( value . GetKeys ( ) ) ;
810
810
indexKeys . SortInPlace ( ) ;
811
811
foreach ( string index in indexKeys )
812
812
{
@@ -926,7 +926,7 @@ public virtual JToken Expand(Context activeCtx, string activeProperty, JToken el
926
926
// 8.1)
927
927
// TODO: is this method faster than just using containsKey for
928
928
// each?
929
- ICollection < string > keySet = new HashSet < string > ( ( ( IDictionary < string , JToken > ) result ) . Keys ) ;
929
+ ICollection < string > keySet = new HashSet < string > ( result . GetKeys ( ) ) ;
930
930
keySet . Remove ( "@value" ) ;
931
931
keySet . Remove ( "@index" ) ;
932
932
bool langremoved = keySet . Remove ( "@language" ) ;
@@ -1250,7 +1250,7 @@ internal virtual void GenerateNodeMap(JToken element, JObject
1250
1250
JObject reverseMap = ( JObject ) JsonLD . Collections . Remove
1251
1251
( elem , "@reverse" ) ;
1252
1252
// 6.9.3)
1253
- foreach ( string property in ( ( IDictionary < string , JToken > ) reverseMap ) . Keys )
1253
+ foreach ( string property in reverseMap . GetKeys ( ) )
1254
1254
{
1255
1255
JArray values = ( JArray ) reverseMap [ property ] ;
1256
1256
// 6.9.3.1)
@@ -1268,7 +1268,7 @@ internal virtual void GenerateNodeMap(JToken element, JObject
1268
1268
null , null ) ;
1269
1269
}
1270
1270
// 6.11)
1271
- JArray keys = new JArray ( elem . Keys ) ;
1271
+ JArray keys = new JArray ( element . GetKeys ( ) ) ;
1272
1272
keys . SortInPlace ( ) ;
1273
1273
foreach ( string property_1 in keys )
1274
1274
{
@@ -1414,7 +1414,7 @@ private void Frame(JsonLdApi.FramingContext state, JObject nodes
1414
1414
bool embedOn = GetFrameFlag ( frame , "@embed" , state . embed ) ;
1415
1415
bool explicicOn = GetFrameFlag ( frame , "@explicit" , state . @explicit ) ;
1416
1416
// add matches to output
1417
- JArray ids = new JArray ( ( ( IDictionary < string , JToken > ) matches ) . Keys ) ;
1417
+ JArray ids = new JArray ( matches . GetKeys ( ) ) ;
1418
1418
ids . SortInPlace ( ) ;
1419
1419
foreach ( string id in ids )
1420
1420
{
@@ -1477,7 +1477,7 @@ private void Frame(JsonLdApi.FramingContext state, JObject nodes
1477
1477
state . embeds [ id ] = embeddedNode ;
1478
1478
// iterate over subject properties
1479
1479
JObject element = ( JObject ) matches [ id ] ;
1480
- JArray props = new JArray ( ( ( IDictionary < string , JToken > ) element ) . Keys ) ;
1480
+ JArray props = new JArray ( element . GetKeys ( ) ) ;
1481
1481
props . SortInPlace ( ) ;
1482
1482
foreach ( string prop in props )
1483
1483
{
@@ -1555,7 +1555,7 @@ private void Frame(JsonLdApi.FramingContext state, JObject nodes
1555
1555
}
1556
1556
}
1557
1557
// handle defaults
1558
- props = new JArray ( ( ( IDictionary < string , JToken > ) frame ) . Keys ) ;
1558
+ props = new JArray ( frame . GetKeys ( ) ) ;
1559
1559
props . SortInPlace ( ) ;
1560
1560
foreach ( string prop_1 in props )
1561
1561
{
@@ -1684,7 +1684,7 @@ private static void RemoveDependents(IDictionary<string, JsonLdApi.EmbedNode> em
1684
1684
private JObject FilterNodes ( JsonLdApi . FramingContext state , JObject nodes , JObject frame )
1685
1685
{
1686
1686
JObject rval = new JObject ( ) ;
1687
- foreach ( string id in ( ( IDictionary < string , JToken > ) nodes ) . Keys )
1687
+ foreach ( string id in nodes . GetKeys ( ) )
1688
1688
{
1689
1689
JObject element = ( JObject ) nodes [ id ] ;
1690
1690
if ( element != null && FilterNode ( state , element , frame ) )
@@ -1741,7 +1741,7 @@ private bool FilterNode(JsonLdApi.FramingContext state, JObject node, JObject fr
1741
1741
}
1742
1742
else
1743
1743
{
1744
- foreach ( string key in ( ( IDictionary < string , JToken > ) frame ) . Keys )
1744
+ foreach ( string key in frame . GetKeys ( ) )
1745
1745
{
1746
1746
if ( "@id" . Equals ( key ) || ! JsonLdUtils . IsKeyword ( key ) && ! ( node . ContainsKey ( key ) ) )
1747
1747
{
@@ -1817,7 +1817,7 @@ private void EmbedValues(JsonLdApi.FramingContext state, JObject element, string
1817
1817
s = new JObject ( ) ;
1818
1818
s [ "@id" ] = sid ;
1819
1819
}
1820
- foreach ( string prop in ( ( IDictionary < string , JToken > ) s ) . Keys )
1820
+ foreach ( string prop in s . GetKeys ( ) )
1821
1821
{
1822
1822
// copy keywords
1823
1823
if ( JsonLdUtils . IsKeyword ( prop ) )
@@ -2005,7 +2005,7 @@ public virtual JArray FromRDF(RDFDataset dataset)
2005
2005
}
2006
2006
}
2007
2007
// 4)
2008
- foreach ( string name_1 in ( ( IDictionary < string , JToken > ) graphMap ) . Keys )
2008
+ foreach ( string name_1 in graphMap . GetKeys ( ) )
2009
2009
{
2010
2010
JObject graph = ( JObject ) graphMap [ name_1 ] ;
2011
2011
// 4.1)
@@ -2077,7 +2077,7 @@ public virtual JArray FromRDF(RDFDataset dataset)
2077
2077
// 5)
2078
2078
JArray result = new JArray ( ) ;
2079
2079
// 6)
2080
- JArray ids = new JArray ( ( ( IDictionary < string , JToken > ) defaultGraph ) . Keys ) ;
2080
+ JArray ids = new JArray ( defaultGraph . GetKeys ( ) ) ;
2081
2081
ids . SortInPlace ( ) ;
2082
2082
foreach ( string subject_1 in ids )
2083
2083
{
@@ -2088,7 +2088,7 @@ public virtual JArray FromRDF(RDFDataset dataset)
2088
2088
// 6.1.1)
2089
2089
node [ "@graph" ] = new JArray ( ) ;
2090
2090
// 6.1.2)
2091
- JArray keys = new JArray ( ( ( IDictionary < string , JToken > ) graphMap [ subject_1 ] ) . Keys ) ;
2091
+ JArray keys = new JArray ( graphMap [ subject_1 ] . GetKeys ( ) ) ;
2092
2092
keys . SortInPlace ( ) ;
2093
2093
foreach ( string s in keys )
2094
2094
{
@@ -2125,7 +2125,7 @@ public virtual RDFDataset ToRDF()
2125
2125
nodeMap [ "@default" ] = new JObject ( ) ;
2126
2126
GenerateNodeMap ( this . value , nodeMap ) ;
2127
2127
RDFDataset dataset = new RDFDataset ( this ) ;
2128
- foreach ( string graphName in ( ( IDictionary < string , JToken > ) nodeMap ) . Keys )
2128
+ foreach ( string graphName in nodeMap . GetKeys ( ) )
2129
2129
{
2130
2130
// 4.1)
2131
2131
if ( JsonLdUtils . IsRelativeIri ( graphName ) )
@@ -2151,7 +2151,7 @@ public virtual JToken Normalize(JObject dataset)
2151
2151
// create quads and map bnodes to their associated quads
2152
2152
JArray quads = new JArray ( ) ;
2153
2153
JObject bnodes = new JObject ( ) ;
2154
- foreach ( string graphName in ( ( IDictionary < string , JToken > ) dataset ) . Keys )
2154
+ foreach ( string graphName in dataset . GetKeys ( ) )
2155
2155
{
2156
2156
var eachGraphName = graphName ;
2157
2157
JArray triples = ( JArray ) dataset [ eachGraphName ] ;
@@ -2198,7 +2198,7 @@ public virtual JToken Normalize(JObject dataset)
2198
2198
// mapping complete, start canonical naming
2199
2199
NormalizeUtils normalizeUtils = new NormalizeUtils ( quads , bnodes , new UniqueNamer
2200
2200
( "_:c14n" ) , opts ) ;
2201
- return normalizeUtils . HashBlankNodes ( ( ( IDictionary < string , JToken > ) bnodes ) . Keys ) ;
2201
+ return normalizeUtils . HashBlankNodes ( bnodes . GetKeys ( ) ) ;
2202
2202
}
2203
2203
2204
2204
private sealed class _Dictionary_1910 : JObject
0 commit comments