|
3840 | 3840 | }]
|
3841 | 3841 | }])
|
3842 | 3842 | },
|
| 3843 | + "embedded node with reverse relationship": { |
| 3844 | + input: %({ |
| 3845 | + "@context": { |
| 3846 | + "rel": {"@reverse": "ex:rel"} |
| 3847 | + }, |
| 3848 | + "@id": { |
| 3849 | + "@id": "ex:rei", |
| 3850 | + "rel": {"@id": "ex:value"} |
| 3851 | + }, |
| 3852 | + "ex:prop": "value2" |
| 3853 | + }), |
| 3854 | + output: %([{ |
| 3855 | + "@id": { |
| 3856 | + "@id": "ex:rei", |
| 3857 | + "@reverse": { |
| 3858 | + "ex:rel": [{"@id": "ex:value"}] |
| 3859 | + } |
| 3860 | + }, |
| 3861 | + "ex:prop": [{"@value": "value2"}] |
| 3862 | + }]) |
| 3863 | + }, |
| 3864 | + "embedded node with expanded reverse relationship": { |
| 3865 | + input: %({ |
| 3866 | + "@id": { |
| 3867 | + "@id": "ex:rei", |
| 3868 | + "@reverse": { |
| 3869 | + "ex:rel": {"@id": "ex:value"} |
| 3870 | + } |
| 3871 | + }, |
| 3872 | + "ex:prop": "value2" |
| 3873 | + }), |
| 3874 | + output: %([{ |
| 3875 | + "@id": { |
| 3876 | + "@id": "ex:rei", |
| 3877 | + "@reverse": { |
| 3878 | + "ex:rel": [{"@id": "ex:value"}] |
| 3879 | + } |
| 3880 | + }, |
| 3881 | + "ex:prop": [{"@value": "value2"}] |
| 3882 | + }]) |
| 3883 | + }, |
| 3884 | + "embedded node used as subject in reverse relationship": { |
| 3885 | + input: %({ |
| 3886 | + "@context": { |
| 3887 | + "rel": {"@reverse": "ex:rel"} |
| 3888 | + }, |
| 3889 | + "@id": { |
| 3890 | + "@id": "ex:rei", |
| 3891 | + "ex:prop": {"@id": "ex:value"} |
| 3892 | + }, |
| 3893 | + "rel": {"@id": "ex:value2"} |
| 3894 | + }), |
| 3895 | + output: %([{ |
| 3896 | + "@id": { |
| 3897 | + "@id": "ex:rei", |
| 3898 | + "ex:prop": [{"@id": "ex:value"}] |
| 3899 | + }, |
| 3900 | + "@reverse": { |
| 3901 | + "ex:rel": [{"@id": "ex:value2"}] |
| 3902 | + } |
| 3903 | + }]) |
| 3904 | + }, |
| 3905 | + "embedded node used as object in reverse relationship": { |
| 3906 | + input: %({ |
| 3907 | + "@context": { |
| 3908 | + "rel": {"@reverse": "ex:rel"} |
| 3909 | + }, |
| 3910 | + "@id": "ex:subj", |
| 3911 | + "rel": { |
| 3912 | + "@id": "ex:rei", |
| 3913 | + "ex:prop": {"@id": "ex:value"} |
| 3914 | + } |
| 3915 | + }), |
| 3916 | + output: %([{ |
| 3917 | + "@id": "ex:subj", |
| 3918 | + "@reverse": { |
| 3919 | + "ex:rel": [{ |
| 3920 | + "@id": "ex:rei", |
| 3921 | + "ex:prop": [{"@id": "ex:value"}] |
| 3922 | + }] |
| 3923 | + } |
| 3924 | + }]) |
| 3925 | + }, |
| 3926 | + "node with @annotation property on node object with reverse relationship": { |
| 3927 | + input: %({ |
| 3928 | + "@context": { |
| 3929 | + "knownBy": {"@reverse": "ex:knows"} |
| 3930 | + }, |
| 3931 | + "@id": "ex:bob", |
| 3932 | + "ex:name": "Bob", |
| 3933 | + "knownBy": { |
| 3934 | + "@id": "ex:fred", |
| 3935 | + "ex:name": "Fred", |
| 3936 | + "@annotation": {"ex:certainty": 0.8} |
| 3937 | + } |
| 3938 | + }), |
| 3939 | + output: %([{ |
| 3940 | + "@id": "ex:bob", |
| 3941 | + "ex:name": [{"@value": "Bob"}], |
| 3942 | + "@reverse": { |
| 3943 | + "ex:knows": [{ |
| 3944 | + "@id": "ex:fred", |
| 3945 | + "ex:name": [{"@value": "Fred"}], |
| 3946 | + "@annotation": [{"ex:certainty": [{"@value": 0.8}]}] |
| 3947 | + }] |
| 3948 | + } |
| 3949 | + }]) |
| 3950 | + }, |
| 3951 | + "reverse relationship inside annotation": { |
| 3952 | + input: %({ |
| 3953 | + "@context": { |
| 3954 | + "claims": {"@reverse": "ex:claims", "@type": "@id"} |
| 3955 | + }, |
| 3956 | + "@id": "ex:bob", |
| 3957 | + "ex:knows": { |
| 3958 | + "@id": "ex:jane", |
| 3959 | + "@annotation": { |
| 3960 | + "ex:certainty": 0.8, |
| 3961 | + "claims": "ex:sue" |
| 3962 | + } |
| 3963 | + } |
| 3964 | + }), |
| 3965 | + output: %([{ |
| 3966 | + "@id": "ex:bob", |
| 3967 | + "ex:knows": [{ |
| 3968 | + "@id": "ex:jane", |
| 3969 | + "@annotation": [{ |
| 3970 | + "ex:certainty": [{"@value": 0.8}], |
| 3971 | + "@reverse": { |
| 3972 | + "ex:claims": [{"@id": "ex:sue"}] |
| 3973 | + } |
| 3974 | + }] |
| 3975 | + }] |
| 3976 | + }]) |
| 3977 | + }, |
3843 | 3978 | }.each do |title, params|
|
3844 | 3979 | it(title) {run_expand params.merge(rdfstar: true)}
|
3845 | 3980 | end
|
|
0 commit comments